diff options
| author | Steve Block <steveblock@google.com> | 2009-11-23 17:44:27 +0000 |
|---|---|---|
| committer | Steve Block <steveblock@google.com> | 2009-11-23 18:37:04 +0000 |
| commit | 4bd4989daad3940ee44fc1cd88f1b805f187e171 (patch) | |
| tree | 44b0e0447470c699af6071790d35a622607c4dac /WebCore | |
| parent | 9fa16a4ebbbdd4ea92df6360067c96f06dd2d961 (diff) | |
| download | external_webkit-4bd4989daad3940ee44fc1cd88f1b805f187e171.zip external_webkit-4bd4989daad3940ee44fc1cd88f1b805f187e171.tar.gz external_webkit-4bd4989daad3940ee44fc1cd88f1b805f187e171.tar.bz2 | |
Updates an Android-specific work-around in V8GCController.cpp now that std::sort is available on Android.
Change-Id: Ia6cf2f309894c877e23ad8f07439d0892810cbb2
Diffstat (limited to 'WebCore')
| -rw-r--r-- | WebCore/bindings/v8/V8GCController.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/WebCore/bindings/v8/V8GCController.cpp b/WebCore/bindings/v8/V8GCController.cpp index 4ef3bb8..242954c 100644 --- a/WebCore/bindings/v8/V8GCController.cpp +++ b/WebCore/bindings/v8/V8GCController.cpp @@ -264,12 +264,12 @@ bool operator<(const GrouperItem& a, const GrouperItem& b) typedef Vector<GrouperItem> GrouperList; #if PLATFORM(ANDROID) -// Sort GrouperList by the group id. Node* is only involved to sort within -// a group id, so it will be fine. -// TODO(andreip): used by std::stable_sort function. We can implement -// the std::sort function and remove this one. -static bool compareGrouperItem(const GrouperItem& a, const GrouperItem& b) { - return a.groupId() < b.groupId(); +// Android's implementation of std::sort seems unable to do the necessary +// template matching to pick up operator< for GrouperItem, so we have to +// manually pass a comparison function. +static bool compareGrouperItem(const GrouperItem& a, const GrouperItem& b) +{ + return a < b; } #endif @@ -311,11 +311,10 @@ public: void applyGrouping() { + // Group by sorting by the group id. #if PLATFORM(ANDROID) - // TODO(andreip): implement std::sort() and get rid of this. - std::stable_sort<GrouperItem>(m_grouper.begin(), m_grouper.end(), compareGrouperItem); + std::sort(m_grouper.begin(), m_grouper.end(), compareGrouperItem); #else - // Group by sorting by the group id. std::sort(m_grouper.begin(), m_grouper.end()); #endif |
