public boolean contains()

in graphjet-core/src/main/java/com/twitter/graphjet/hashing/SmallArrayBasedLongToDoubleMap.java [275:289]


  public boolean contains(long key) {
    // The size might have reached the ADD_KEYS_TO_SET_THRESHOLD, but we may have not inserted
    // a new key yet. Therefore, we need to also check if the size is equal to that threshold.
    if (size <= ADD_KEYS_TO_SET_THRESHOLD) {
      for (int i = 0; i < size; i++) {
        if (key == keys[i]) {
          return true;
        }
      }
    } else if (keySet.contains(key)) {
      return true;
    }

    return false;
  }