Chromium Code Reviews| Index: chrome/browser/chromeos/input_method/input_method_util.cc |
| diff --git a/chrome/browser/chromeos/input_method/input_method_util.cc b/chrome/browser/chromeos/input_method/input_method_util.cc |
| index 97971601d00109f31cc9f2091f85829bdd351d2a..432653aadf8ddbae35de4bc45c3b0c8b9d902848 100644 |
| --- a/chrome/browser/chromeos/input_method/input_method_util.cc |
| +++ b/chrome/browser/chromeos/input_method/input_method_util.cc |
| @@ -690,12 +690,8 @@ bool InputMethodUtil::MigrateInputMethods( |
| } |
| if (rewritten) { |
| // Removes the duplicates. |
| - std::vector<std::string> new_ids; |
| - for (size_t i = 0; i < ids.size(); ++i) { |
| - if (std::find(new_ids.begin(), new_ids.end(), ids[i]) == new_ids.end()) |
| - new_ids.push_back(ids[i]); |
| - } |
| - ids.swap(new_ids); |
| + std::sort(ids.begin(), ids.end()); |
|
Shu Chen
2016/03/24 13:05:31
The sort() here is risky since the order of the in
chakshu
2016/04/04 05:28:32
Okay, I was not aware that the order of input meth
Shu Chen
2016/04/04 12:48:15
I'm not sure whether std::unique can do the thing.
chakshu
2016/04/11 06:54:37
Done !
Also if you want it to be done in-place wit
|
| + ids.erase(std::unique(ids.begin(), ids.end()), ids.end()); |
| } |
| return rewritten; |
| } |