/// <summary> /// Dictionary.TryGetValue(string) /// </summary> internal int FindString(string name) { if (m_map == null) { FixedHashTable map = new FixedHashTable(m_size); for (int i = 0; i < m_size; i++) { map.Add(GetStringHash(i), i); } m_map = map; } int hash = StringPool.StableStringHash(name); // Search hash table for (int slot = m_map.GetFirst(hash); slot >= 0; slot = m_map.GetNext(slot)) { int index = m_map.GetIndex(slot); if (IsStringEqual(name, index)) { return(index); } } return(-1); }
internal StringMap32(StringPool pool, UInt32[] indices) : base(indices.Length) { m_pool = pool; m_indices = indices; }
/// <summary> /// Set data for compressed strings /// </summary> public void SetStringPool(byte[] dictionary, byte[] strings, ushort[] index) { m_stringPool = new StringPool(dictionary, strings, index); }
internal StringMap32(StringPool pool, UInt32[] indices) : base(indices.Length) { m_pool = pool; m_indices = indices; }