Ejemplo 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);
        }
Ejemplo 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);
            }
        }
Ejemplo n.º 5
0
 internal void SetCachedValue(Object value)
 {
     NameCacheEntry entry = new NameCacheEntry();
     entry.name = name;
     entry.value = value;
     nameCache[probe] = entry;
 }
Ejemplo 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;
 }