cmpUint8Array2.js 484 B

12345678910111213141516
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.cmpUint8Array2 = void 0;
  4. const cmpUint8Array2 = (a, b) => {
  5. const len1 = a.length;
  6. const len2 = b.length;
  7. const len = Math.min(len1, len2);
  8. for (let i = 0; i < len; i++) {
  9. const diffChar = a[i] - b[i];
  10. if (diffChar !== 0)
  11. return diffChar;
  12. }
  13. return len1 - len2;
  14. };
  15. exports.cmpUint8Array2 = cmpUint8Array2;
  16. //# sourceMappingURL=cmpUint8Array2.js.map