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

StringHashCode() static private method

static private StringHashCode ( FacetLabel label ) : int
label FacetLabel
return int
        internal static int StringHashCode(FacetLabel label)
        {
            int hash = label.GetHashCode();

            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 ( Lucene.Net.Facet.Taxonomy.WriterCache.CharBlockArray labelRepository, int offset ) : 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