Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact
Show
Ignore:
Timestamp:
03/23/10 02:19:11 (2 years ago)
Author:
kris
Message:

added support for retaining the key hash-value (via a -version=HashCache? in the interim)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tango/util/container/HashMap.d

    r5418 r5421  
    7272{ 
    7373        // bucket types 
    74         private alias Slink!(V, K) Type; 
     74        version (HashCache) 
     75                 private alias Slink!(V, K, false, true) Type; 
     76            else 
     77                private alias Slink!(V, K) Type; 
     78 
    7579        private alias Type         *Ref; 
    7680 
     
    896900                               { 
    897901                               auto n = bucket.next; 
    898                                auto h = Hash (bucket.key, newCap); 
     902                               version (HashCache) 
     903                                        auto h = n.cache; 
     904                                  else 
     905                                     auto h = Hash (bucket.key, newCap); 
    899906                               bucket.next = newtab[h]; 
    900907                               newtab[h] = bucket;