refactor: use C++20's contains() method (35-x-y) (#45768)
refactor: use C++20's contains() method (#45742) * chore: use std::map<>::contains() instead of count() or find() * chore: use std::map<>::contains() instead of base::Contains()
This commit is contained in:
parent
2da02ec9bc
commit
4c81971213
29 changed files with 52 additions and 75 deletions
|
@ -12,7 +12,6 @@
|
|||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "base/containers/contains.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/numerics/safe_conversions.h"
|
||||
#include "base/strings/utf_string_conversion_utils.h"
|
||||
|
@ -190,13 +189,13 @@ void SpellCheckClient::OnSpellCheckDone(
|
|||
auto& word_list = pending_request_param_->wordlist();
|
||||
|
||||
for (const auto& word : word_list) {
|
||||
if (base::Contains(misspelled, word.text)) {
|
||||
if (misspelled.contains(word.text)) {
|
||||
// If this is a contraction, iterate through parts and accept the word
|
||||
// if none of them are misspelled
|
||||
if (!word.contraction_words.empty()) {
|
||||
auto all_correct = true;
|
||||
for (const auto& contraction_word : word.contraction_words) {
|
||||
if (base::Contains(misspelled, contraction_word)) {
|
||||
if (misspelled.contains(contraction_word)) {
|
||||
all_correct = false;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue