private bool AddLabelOffsetToHashArray(HashArray a, int hash, int ordinal, int knownOffset) { int index = CompactLabelToOrdinal.IndexFor(hash, a.offsets.Length); int offset = a.offsets[index]; if (offset == 0) { a.offsets[index] = knownOffset; a.cids[index] = ordinal; return(true); } return(false); }
private static bool AddLabelOffsetToHashArray(HashArray a, int hash, int ordinal, int knownOffset) // LUCENENET: CA1822: Mark members as static { int index = CompactLabelToOrdinal.IndexFor(hash, a.offsets.Length); int offset = a.offsets[index]; if (offset == 0) { a.offsets[index] = knownOffset; a.cids[index] = ordinal; return(true); } return(false); }
private bool AddLabel(HashArray a, FacetLabel label, int hash, int ordinal) { int index = CompactLabelToOrdinal.IndexFor(hash, a.offsets.Length); int offset = a.offsets[index]; if (offset == 0) { a.offsets[index] = this.labelRepository.Length; CategoryPathUtils.Serialize(label, labelRepository); a.cids[index] = ordinal; return(true); } return(false); }