MCPcopy Index your code
hub / github.com/nodejs/node / compareSmallSets

Function compareSmallSets

lib/internal/util/comparisons.js:724–740  ·  view source on GitHub ↗
(a, b, val, iteratorB, mode, memo)

Source from the content-addressed store, hash-verified

722}
723
724function compareSmallSets(a, b, val, iteratorB, mode, memo) {
725 const iteratorA = a.values();
726 const firstA = iteratorA.next().value;
727 const first = innerDeepEqual(firstA, val, mode, memo);
728 if (first) {
729 if (b.size === 1) { // Partial mode && a.size === 1 || b.size === 1
730 return true;
731 }
732 const secondA = iteratorA.next().value;
733 return b.has(secondA) || innerDeepEqual(secondA, iteratorB.next().value, mode, memo);
734 }
735 return a.size !== 1 && innerDeepEqual(iteratorA.next().value, val, mode, memo) && (
736 b.size === 1 || // Partial mode
737 b.has(firstA) || // Primitive or reference equal
738 innerDeepEqual(firstA, iteratorB.next().value, mode, memo)
739 );
740}
741
742function setEquiv(a, b, mode, memo) {
743 // This is a lazily initiated Set of entries which have to be compared

Callers 1

setEquivFunction · 0.85

Calls 4

innerDeepEqualFunction · 0.85
nextMethod · 0.65
hasMethod · 0.65
valuesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…