3 ms·
4 spaces and you can get code styling: Like this Or rather outer: for (var i = 0, j = 0; i < nlen; i++) { var nch = needle.charCodeAt(i);
by joshstrange 11y ago
4 spaces and you can get code styling:
Like this
Or rather
outer: for (var i = 0, j = 0; i < nlen; i++) {
var nch = needle.charCodeAt(i);
while (j < hlen) {
if (haystack.charCodeAt(j++) === nch) {
continue outer;
}
}
return false;
}