Changeset 14728 in webkit for trunk/JavaScriptCore/wtf/Vector.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/Vector.h

    r14263 r14728  
    580580
    581581    template<typename T, size_t inlineCapacity>
    582     void deleteAllValues(Vector<T, inlineCapacity>& collection)
    583     {
    584         typedef Vector<T, inlineCapacity> Vec;
    585         typename Vec::iterator end = collection.end();
    586         for (typename Vec::iterator it = collection.begin(); it != end; ++it)
     582    void deleteAllValues(const Vector<T, inlineCapacity>& collection)
     583    {
     584        typedef typename Vector<T, inlineCapacity>::const_iterator iterator;
     585        iterator end = collection.end();
     586        for (iterator it = collection.begin(); it != end; ++it)
    587587            delete *it;
    588588    }
Note: See TracChangeset for help on using the changeset viewer.