Unreviewed, rolling out r156307.
[WebKit-https.git] / Source / WebCore / page / CaptionUserPreferences.cpp
index f8c4d09..2375ed3 100644 (file)
@@ -173,6 +173,11 @@ String CaptionUserPreferences::displayNameForTrack(TextTrack* track) const
     return trackDisplayName(track);
 }
     
+static bool textTrackCompare(const RefPtr<TextTrack>& a, const RefPtr<TextTrack>& b)
+{
+    return codePointCompare(trackDisplayName(a.get()), trackDisplayName(b.get())) < 0;
+}
+
 Vector<RefPtr<TextTrack>> CaptionUserPreferences::sortedTrackListForMenu(TextTrackList* trackList)
 {
     ASSERT(trackList);
@@ -182,9 +187,7 @@ Vector<RefPtr<TextTrack>> CaptionUserPreferences::sortedTrackListForMenu(TextTra
     for (unsigned i = 0, length = trackList->length(); i < length; ++i)
         tracksForMenu.append(trackList->item(i));
 
-    std::sort(tracksForMenu.begin(), tracksForMenu.end(), [](const RefPtr<TextTrack>& a, const RefPtr<TextTrack>& b) {
-        return codePointCompare(trackDisplayName(a.get()), trackDisplayName(b.get())) < 0;
-    });
+    std::sort(tracksForMenu.begin(), tracksForMenu.end(), textTrackCompare);
 
     tracksForMenu.insert(0, TextTrack::captionMenuOffItem());
     tracksForMenu.insert(1, TextTrack::captionMenuAutomaticItem());