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

Function prefixLen

data/codebrowser.js:263–271  ·  view source on GitHub ↗
( s1 , s2)

Source from the content-addressed store, hash-verified

261 //compute the length of the common prefix between two strings
262 // duplicated indexscript.js
263 var prefixLen = function( s1 , s2) {
264 var maxMatchLen = Math.min(s1.length, s2.length);
265 var res = -1;
266 while (++res < maxMatchLen) {
267 if (s1.charAt(res) != s2.charAt(res))
268 break;
269 }
270 return res * 256 + 256 - s1.length;
271 }
272
273 function absoluteUrl(relative) {
274 var a = document.createElement('a');

Callers 4

pFunction · 0.70
computeTooltipContentFunction · 0.70
onMouseEnterRefFunction · 0.70
activateFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected