MCPcopy Create free account
hub / github.com/KDAB/codebrowser / prefixLen

Function prefixLen

data/indexscript.js:32–40  ·  view source on GitHub ↗
( s1 , s2)

Source from the content-addressed store, hash-verified

30 //compute the length of the common prefix between two strings
31 // (copied from codebrowser.js)
32 var prefixLen = function( s1 , s2) {
33 var maxMatchLen = Math.min(s1.length, s2.length);
34 var res = -1;
35 while (++res < maxMatchLen) {
36 if (s1.charAt(res) != s2.charAt(res))
37 break;
38 }
39 return res * 256 + 256 - s1.length;
40 }
41
42 // Google text search (different than codebrowser.js)
43 var text_search = function(text) {

Callers 1

activateFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected