RESOLVED FIXED 75359
It should be easier to iterate a Vector backwards
https://bugs.webkit.org/show_bug.cgi?id=75359
Summary It should be easier to iterate a Vector backwards
Sam Weinig
Reported 2011-12-29 09:13:15 PST
It should be easier to iterate a Vector backwards
Attachments
Patch (21.50 KB, patch)
2011-12-29 09:24 PST, Sam Weinig
andersca: review+
webkit.review.bot: commit-queue-
Sam Weinig
Comment 1 2011-12-29 09:14:39 PST
The current method of iterating Vectors backwards is a bit ugly and doesn't work with C++11 range-based for loops. I want an easier way!
Sam Weinig
Comment 2 2011-12-29 09:24:15 PST
WebKit Review Bot
Comment 3 2011-12-29 09:26:53 PST
Attachment 120753 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1 Source/JavaScriptCore/wtf/Vector.h:484: reverse_iterator is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Source/JavaScriptCore/wtf/Vector.h:485: const_reverse_iterator is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Total errors found: 2 in 9 files If any of these errors are false positives, please file a bug against check-webkit-style.
Anders Carlsson
Comment 4 2011-12-29 09:27:56 PST
Comment on attachment 120753 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=120753&action=review > Tools/ChangeLog:11 > + to work on windows. Please explain why we set GTEST_HAS_TR1_TUPLE to 0 here. > Tools/TestWebKitAPI/Tests/Vector.cpp:82 > +// Vector::reveresed() can only be tested if auto and range-for support is > +// availiable. Typo, reveresed. Also, this isn't true. You could do something like for (Vector<int>::const_iterator it = intVector.reversed.begin(), end = intVector.reversed.end(); it != end; ++it) { }
Sam Weinig
Comment 5 2011-12-29 09:35:25 PST
(In reply to comment #4) > (From update of attachment 120753 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=120753&action=review > > > Tools/ChangeLog:11 > > + to work on windows. > > Please explain why we set GTEST_HAS_TR1_TUPLE to 0 here. Ok. > > > Tools/TestWebKitAPI/Tests/Vector.cpp:82 > > +// Vector::reveresed() can only be tested if auto and range-for support is > > +// availiable. > > Typo, reveresed. Also, this isn't true. You could do something like > > for (Vector<int>::const_iterator it = intVector.reversed.begin(), end = intVector.reversed.end(); it != end; ++it) { } Doh. I will change to test that way. weinig--.
Sam Weinig
Comment 6 2011-12-29 09:52:17 PST
Actually, if I don't need to use auto, I don't really need to change TestWebKitAPI to use C++11, but that might be nice on its own since then we could add tests for the rvalue stuff I added to RetainPtr and friends. Thoughts? Do all the bots have new enough clang/libc++ for this not to break stuff?
WebKit Review Bot
Comment 7 2011-12-29 10:06:57 PST
Comment on attachment 120753 [details] Patch Attachment 120753 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11035925
Sam Weinig
Comment 8 2011-12-29 20:50:30 PST
Note You need to log in before you can comment on or make changes to this bug.