(file) Return to HashTable.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/HashTable.cpp between version 1.3 and 1.12

version 1.3, 2001/04/27 18:46:20 version 1.12, 2002/06/01 00:56:33
Line 1 
Line 1 
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM  // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
   // The Open Group, Tivoli Systems
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a  // Permission is hereby granted, free of charge, to any person obtaining a copy
 // copy of this software and associated documentation files (the "Software"),  // of this software and associated documentation files (the "Software"), to
 // to deal in the Software without restriction, including without limitation  // deal in the Software without restriction, including without limitation the
 // the rights to use, copy, modify, merge, publish, distribute, sublicense,  // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 // and/or sell copies of the Software, and to permit persons to whom the  // sell copies of the Software, and to permit persons to whom the Software is
 // Software is furnished to do so, subject to the following conditions:  // furnished to do so, subject to the following conditions:
 //  //
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL  // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER  // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING  // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER  // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 // DEALINGS IN THE SOFTWARE.  // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
   // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 // //
 //============================================================================== //==============================================================================
 // //
Line 40 
Line 42 
 { {
     Uint32 h = 0;     Uint32 h = 0;
  
     for (Uint32 i = 0, n = str.getLength(); i < n; i++)      for (Uint32 i = 0, n = str.size(); i < n; i++)
         h = 5 * h + str[i];         h = 5 * h + str[i];
  
     return h;     return h;
Line 104 
Line 106 
     _BucketBase** first,     _BucketBase** first,
     _BucketBase** last) : _first(first), _last(last)     _BucketBase** last) : _first(first), _last(last)
 { {
       _bucket = 0;
   
     while (_first != last)     while (_first != last)
     {     {
         if (*_first)         if (*_first)
Line 213 
Line 217 
     Uint32 i = hashCode % _numChains;     Uint32 i = hashCode % _numChains;
     _BucketBase* last = 0;     _BucketBase* last = 0;
  
     for (_BucketBase* bucket = _chains[i]; bucket; bucket = bucket->next)      for (_BucketBase* b = _chains[i]; b; b = b->next)
     {     {
         if (bucket->equal(key))          if (b->equal(key))
         {         {
             delete bucket;             delete bucket;
             return false;             return false;
         }         }
  
         last = bucket;          last = b;
     }     }
  
     // Insert bucket:     // Insert bucket:
Line 239 
Line 243 
  
 const _BucketBase* _HashTableRep::lookup( const _BucketBase* _HashTableRep::lookup(
     Uint32 hashCode,     Uint32 hashCode,
     const void* key)      const void* key) const
 { {
     Uint32 i = hashCode % _numChains;     Uint32 i = hashCode % _numChains;
  


Legend:
Removed from v.1.3  
changed lines
  Added in v.1.12

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2