Esempio n. 1
0
        internal void SetCachedValue(Object value)
        {
            NameCacheEntry entry = new NameCacheEntry();

            entry.name       = name;
            entry.value      = value;
            nameCache[probe] = entry;
        }
 internal object GetCachedValue(string name)
 {
     this.name = name;
     this.probe = Math.Abs(name.GetHashCode()) % 0x161;
     NameCacheEntry entry = nameCache[this.probe];
     if (entry == null)
     {
         entry = new NameCacheEntry {
             name = name
         };
         return null;
     }
     if (entry.name == name)
     {
         return entry.value;
     }
     return null;
 }
        internal object GetCachedValue(string name)
        {
            this.name  = name;
            this.probe = Math.Abs(name.GetHashCode()) % 0x161;
            NameCacheEntry entry = nameCache[this.probe];

            if (entry == null)
            {
                entry = new NameCacheEntry {
                    name = name
                };
                return(null);
            }
            if (entry.name == name)
            {
                return(entry.value);
            }
            return(null);
        }
Esempio n. 4
0
        internal Object GetCachedValue(String name)
        {
            this.name = name;
            probe     = Math.Abs(name.GetHashCode()) % MAX_CACHE_ENTRIES;
            NameCacheEntry entry = nameCache[probe];

            if (entry == null)
            {
                entry      = new NameCacheEntry();
                entry.name = name;
                return(null);
            }
            else if (entry.name == name)
            {
                return(entry.value);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 5
0
 internal void SetCachedValue(Object value)
 {
     NameCacheEntry entry = new NameCacheEntry();
     entry.name = name;
     entry.value = value;
     nameCache[probe] = entry;
 }
Esempio n. 6
0
 internal Object GetCachedValue(String name)
 {
     this.name = name;
     probe = Math.Abs(name.GetHashCode())%MAX_CACHE_ENTRIES;
     NameCacheEntry entry = nameCache[probe];
     if (entry == null)
     {
         entry = new NameCacheEntry();
         entry.name = name;
         return null;
     }
     else if (entry.name == name)
     {
         return entry.value;
     }
     else
         return null;
 }