OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be found |
| 3 // in the LICENSE file. |
| 4 |
| 5 #include "core/editing/TextSuggestionList.h" |
| 6 |
| 7 namespace blink { |
| 8 |
| 9 bool TextSuggestionList::operator<(const TextSuggestionList& other) const { |
| 10 int length = end - start; |
| 11 int otherLength = other.end - other.start; |
| 12 |
| 13 if (length != otherLength) { |
| 14 return length < otherLength; |
| 15 } |
| 16 |
| 17 // If the text range lengths are the same, pick some arbitrary yet stable |
| 18 // order |
| 19 return suggestionID < other.suggestionID; |
| 20 } |
| 21 |
| 22 } // namespace blink |
OLD | NEW |