MCPcopy Create free account
hub / github.com/axhlzy/Il2CppHookScripts / compare

Function compare

Il2cppHook/_Ufunc.js:13468–13482  ·  view source on GitHub ↗
(v1, v2, complete)

Source from the content-addressed store, hash-verified

13466};
13467
13468function compare(v1, v2, complete){
13469 v1 = String(v1);
13470 v2 = String(v2);
13471 if(v1 === v2){return 0;}
13472 var v1s = v1.split(delimiter);
13473 var v2s = v2.split(delimiter);
13474 var len = Math[complete ? "max" : "min"](v1s.length, v2s.length);
13475 for(var i=0; i<len; i++){
13476 v1s[i] = "undefined"===typeof v1s[i] ? 0 : parseInt(v1s[i], 10);
13477 v2s[i] = "undefined"===typeof v2s[i] ? 0 : parseInt(v2s[i], 10);
13478 if(v1s[i] > v2s[i]){return 1;}
13479 if(v1s[i] < v2s[i]){return -1;}
13480 }
13481 return 0;
13482}
13483
13484Version.compare = function(v1, v2){
13485 return compare(v1, v2, true);

Callers 1

_Ufunc.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected