Changeset 14728 in webkit for trunk/JavaScriptCore/wtf/HashMap.h


Ignore:
Timestamp:
Jun 4, 2006, 3:51:57 PM (19 years ago)
Author:
darin
Message:

Reviewed by Anders.

  • changed deleteAllValues so it can work on "const" collections Deleting the values affects the values, not the pointers in the collection, so it's legitimate to do it to a const collection, and a case of that actually came up in the XPath code.
  • wtf/HashMap.h: (WTF::deleteAllPairSeconds): Use const iterators. (WTF::deleteAllValues): Take const HashMap reference as a parameter.
  • wtf/HashSet.h: (WTF::deleteAllValues): Take const HashSet reference as a parameter, and use const iterators.
  • wtf/Vector.h: (WTF::deleteAllValues): Take const Vector reference as a parameter.
  • added more functions that are present in <math.h> on some platforms, but not on others; moved here from various files in WebCore
  • wtf/MathExtras.h: (isinf): Added. (isnan): Added. (lround): Added. (lroundf): Tweaked. (round): Added. (roundf): Tweaked. (signbit): Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/HashMap.h

    r14256 r14728  
    309309    void deleteAllPairSeconds(HashTableType& collection)
    310310    {
    311         typedef typename HashTableType::iterator iterator;
     311        typedef typename HashTableType::const_iterator iterator;
    312312        iterator end = collection.end();
    313313        for (iterator it = collection.begin(); it != end; ++it)
     
    316316
    317317    template<typename T, typename U, typename V, typename W, typename X>
    318     inline void deleteAllValues(HashMap<T, U, V, W, X>& collection)
     318    inline void deleteAllValues(const HashMap<T, U, V, W, X>& collection)
    319319    {
    320320        deleteAllPairSeconds<typename HashMap<T, U, V, W, X>::MappedType>(collection);
Note: See TracChangeset for help on using the changeset viewer.