ICSharpCode.SharpZipLib.Zip.Compression.DeflaterEngine.InsertString C# (CSharp) Method

InsertString() private method

Inserts the current string in the head hash and returns the previous value for this hash.
private InsertString ( ) : int
return int
        int InsertString()
        {
            short match;
            int hash = ((ins_h << DeflaterConstants.HASH_SHIFT) ^ window[strstart + (DeflaterConstants.MIN_MATCH - 1)]) & DeflaterConstants.HASH_MASK;

            #if DebugDeflation
            if (DeflaterConstants.DEBUGGING)
            {
                if (hash != (((window[strstart] << (2*HASH_SHIFT)) ^
                                  (window[strstart + 1] << HASH_SHIFT) ^
                                  (window[strstart + 2])) & HASH_MASK)) {
                        throw new SharpZipBaseException("hash inconsistent: " + hash + "/"
                                                +window[strstart] + ","
                                                +window[strstart + 1] + ","
                                                +window[strstart + 2] + "," + HASH_SHIFT);
                    }
            }
            #endif
            prev[strstart & DeflaterConstants.WMASK] = match = head[hash];
            head[hash] = unchecked((short)strstart);
            ins_h = hash;
            return match & 0xffff;
        }