Move FilterIterator and IteratorPair to WTF and replement HashMap::keys() and HashMap::values() using IteratorPair
Created attachment 220047 [details] Patch
Anders mentioned he thought this might be a good idea, so I went ahead and did it. I like the cleanup of APIArray::elementsOfType(), but I am bummed I couldn't figure out how to remove the last bit of duplication (the typedef had been duplicated 4 times, and now is down to 2).
Committed r161114: <http://trac.webkit.org/changeset/161114>
Comment on attachment 220047 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=220047&action=review > Source/WTF/wtf/IteratorPair.h:44 > Iterator begin() { return m_begin; } > Iterator end() { return m_end; } > > + Iterator begin() const { return m_begin; } > + Iterator end() const { return m_end; } Why do we need both? Why not just the const ones?
(In reply to comment #4) > (From update of attachment 220047 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=220047&action=review > > > Source/WTF/wtf/IteratorPair.h:44 > > Iterator begin() { return m_begin; } > > Iterator end() { return m_end; } > > > > + Iterator begin() const { return m_begin; } > > + Iterator end() const { return m_end; } > > Why do we need both? Why not just the const ones? You're right, we don't need the non-const one. I will remove it.
(In reply to comment #5) > (In reply to comment #4) > > (From update of attachment 220047 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=220047&action=review > > > > > Source/WTF/wtf/IteratorPair.h:44 > > > Iterator begin() { return m_begin; } > > > Iterator end() { return m_end; } > > > > > > + Iterator begin() const { return m_begin; } > > > + Iterator end() const { return m_end; } > > > > Why do we need both? Why not just the const ones? > > You're right, we don't need the non-const one. I will remove it. Fixed in http://trac.webkit.org/changeset/161162.