bool _findPairingInner()

in lib/src/iterable_matchers.dart [222:238]


  bool _findPairingInner(List<List<int>> edges, int valueIndex,
      List<int?> matched, Set<int> reserved) {
    final possiblePairings =
        edges[valueIndex].where((m) => !reserved.contains(m));
    for (final matcherIndex in possiblePairings) {
      reserved.add(matcherIndex);
      final previouslyMatched = matched[matcherIndex];
      if (previouslyMatched == null ||
          // If the matcher isn't already free, check whether the existing value
          // occupying the matcher can be bumped to another one.
          _findPairingInner(edges, matched[matcherIndex]!, matched, reserved)) {
        matched[matcherIndex] = valueIndex;
        return true;
      }
    }
    return false;
  }