Changeset 12511 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Jan 31, 2006, 8:33:27 PM (19 years ago)
Author:
darin
Message:

Reviewed by Maciej.

  • added deleteAllValues for HashSet as well as HashMap
  • fixed conversion from const_iterator to iterator, which I broke a while back
  • kxmlcore/HashMap.h: Updated copyright date.
  • kxmlcore/HashSet.h: (KXMLCore::deleteAllValues): Added.
  • kxmlcore/HashTable.h: (KXMLCore::HashTableIterator::operator const_iterator): Added.
Location:
trunk/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r12505 r12511  
     12006-01-31  Darin Adler  <[email protected]>
     2
     3        Reviewed by Maciej.
     4
     5        - added deleteAllValues for HashSet as well as HashMap
     6        - fixed conversion from const_iterator to iterator, which I broke a while back
     7
     8        * kxmlcore/HashMap.h: Updated copyright date.
     9        * kxmlcore/HashSet.h: (KXMLCore::deleteAllValues): Added.
     10        * kxmlcore/HashTable.h: (KXMLCore::HashTableIterator::operator const_iterator): Added.
     11
    1122006-01-31  Tim Omernick  <[email protected]>
    213
  • trunk/JavaScriptCore/kxmlcore/HashMap.h

    r12435 r12511  
    33 * This file is part of the KDE libraries
    44 *
    5  * Copyright (C) 2005 Apple Computer, Inc.
     5 * Copyright (C) 2005, 2006 Apple Computer, Inc.
     6 *
    67 * This library is free software; you can redistribute it and/or
    78 * modify it under the terms of the GNU Library General Public
  • trunk/JavaScriptCore/kxmlcore/HashSet.h

    r12329 r12511  
    22/*
    33 * This file is part of the KDE libraries
    4  * Copyright (C) 2005 Apple Computer, Inc.
     4 *
     5 * Copyright (C) 2005, 2006 Apple Computer, Inc.
    56 *
    67 * This library is free software; you can redistribute it and/or
     
    194195    }
    195196
     197    template<typename Value, typename HashFunctions, typename Traits>
     198    void deleteAllValues(HashSet<Value, HashFunctions, Traits>& collection)
     199    {
     200        typedef HashSet<Value, HashFunctions, Traits> T;
     201        typename T::iterator end = collection.end();
     202        for (typename T::iterator it = collection.begin(); it != end; ++it)
     203            delete (*it);
     204    }
     205
    196206} // namespace khtml
    197207
  • trunk/JavaScriptCore/kxmlcore/HashTable.h

    r12328 r12511  
    111111        }
    112112
    113         HashTableConstIterator(const iterator& other)
    114             : m_position(other.m_position), m_endPosition(other.m_endPosition)
    115         {
    116 #if CHECK_HASHTABLE_ITERATORS
    117             addIterator(other.m_table, this);
    118 #endif
    119         }
    120 
    121113        // default copy, assignment and destructor are OK if CHECK_HASHTABLE_ITERATORS is 0
    122114
     
    232224        bool operator==(const iterator& other) const { return m_iterator == other.m_iterator; }
    233225        bool operator!=(const iterator& other) const { return m_iterator != other.m_iterator; }
     226
     227        operator const_iterator() const { return m_iterator; }
    234228
    235229    private:
Note: See TracChangeset for help on using the changeset viewer.