Changeset 247767 in webkit


Ignore:
Timestamp:
Jul 23, 2019 9:29:14 PM (5 years ago)
Author:
keith_miller@apple.com
Message:

Add cheat sheet comment for HashMap/Set iterator/AddResult
https://bugs.webkit.org/show_bug.cgi?id=200061

Reviewed by Saam Barati.

  • wtf/HashMap.h:
  • wtf/HashSet.h:
Location:
trunk/Source/WTF
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r247761 r247767  
     12019-07-23  Keith Miller  <keith_miller@apple.com>
     2
     3        Add cheat sheet comment for HashMap/Set iterator/AddResult
     4        https://bugs.webkit.org/show_bug.cgi?id=200061
     5
     6        Reviewed by Saam Barati.
     7
     8        * wtf/HashMap.h:
     9        * wtf/HashSet.h:
     10
    1112019-07-23  Keith Rollin  <krollin@apple.com>
    212
  • trunk/Source/WTF/wtf/HashMap.h

    r247673 r247767  
    6666
    6767public:
     68    /*
     69     * Since figuring out the entries of an iterator is confusing, here is a cheat sheet:
     70     * const KeyType& key = iterator->key;
     71     * ValueType& value = iterator->value;
     72     */
    6873    using iterator = HashTableIteratorAdapter<HashTableType, KeyValuePairType>;
    6974    using const_iterator = HashTableConstIteratorAdapter<HashTableType, KeyValuePairType>;
     
    7479    using ValuesConstIteratorRange = SizedIteratorRange<HashMap, typename const_iterator::Values>;
    7580
     81    /*
     82     * Since figuring out the entries of an AddResult is confusing, here is a cheat sheet:
     83     * iterator iter = addResult.iterator;
     84     * bool isNewEntry = addResult.isNewEntry;
     85     */
    7686    using AddResult = typename HashTableType::AddResult;
    7787
  • trunk/Source/WTF/wtf/HashSet.h

    r242387 r247767  
    4646
    4747public:
     48    /*
     49     * Since figuring out the entries of an iterator is confusing, here is a cheat sheet:
     50     * const KeyType& key = iterator->key;
     51     */
    4852    typedef HashTableConstIteratorAdapter<HashTableType, ValueType> iterator;
    4953    typedef HashTableConstIteratorAdapter<HashTableType, ValueType> const_iterator;
     54
     55    /*
     56     * Since figuring out the entries of an AddResult is confusing, here is a cheat sheet:
     57     * iterator iter = addResult.iterator;
     58     * bool isNewEntry = addResult.isNewEntry;
     59     */
    5060    typedef typename HashTableType::AddResult AddResult;
    5161
Note: See TracChangeset for help on using the changeset viewer.