Lucene.Net.Facet.Taxonomy.WriterCache.CompactLabelToOrdinal.StringHashCode C# (CSharp) Method

StringHashCode() static private method

static private StringHashCode ( Lucene.Net.Facet.Taxonomy.WriterCache.CharBlockArray labelRepository, int offset ) : int
labelRepository Lucene.Net.Facet.Taxonomy.WriterCache.CharBlockArray
offset int
return int
        internal static int StringHashCode(CharBlockArray labelRepository, int offset)
        {
            int hash = CategoryPathUtils.HashCodeOfSerialized(labelRepository, offset);
            hash = hash ^ (((int)((uint)hash >> 20)) ^ ((int)((uint)hash >> 12)));
            hash = hash ^ ((int)((uint)hash >> 7)) ^ ((int)((uint)hash >> 4));
            return hash;
        }

Same methods

CompactLabelToOrdinal::StringHashCode ( FacetLabel label ) : int

Usage Example

        public override int GetOrdinal(FacetLabel label)
        {
            if (label == null)
            {
                return(LabelToOrdinal.INVALID_ORDINAL);
            }

            int hash = CompactLabelToOrdinal.StringHashCode(label);

            for (int i = 0; i < this.hashArrays.Length; i++)
            {
                int ord = GetOrdinal(this.hashArrays[i], label, hash);
                if (ord != COLLISION)
                {
                    return(ord);
                }
            }

            return(this.collisionMap.Get(label, hash));
        }
All Usage Examples Of Lucene.Net.Facet.Taxonomy.WriterCache.CompactLabelToOrdinal::StringHashCode