Created
September 14, 2012 05:52
-
-
Save benjamn/3720055 to your computer and use it in GitHub Desktop.
Today I wrote a function whose running time was quadratic in the number of characters it took me to write the function.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.testSlice = function(t) { | |
var code = arguments.callee + "", | |
lines = fromString(code); | |
lines.eachPos(function(start) { | |
lines.eachPos(function(end) { | |
check(lines.slice(start, end), | |
lines.bootstrapSlice(start, end)); | |
}, start); | |
}); | |
t.finish(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment