refactor: use std::map::try_emplace() over std::map::insert() (#46761)

refactor: prefer std::map::try_emplace() over std::map::insert()
This commit is contained in:
Charles Kerr 2025-04-25 13:11:53 -05:00 committed by GitHub
parent 8fa7d324d1
commit b40b4dc015
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 15 additions and 21 deletions

View file

@ -746,7 +746,7 @@ void FileSystemAccessPermissionContext::SetLastPickedDirectory(
base::Value::Dict dict;
dict.Set(GenerateLastPickedDirectoryKey(id), std::move(entry));
MaybeEvictEntries(dict);
id_pathinfo_map_.insert(std::make_pair(origin, std::move(dict)));
id_pathinfo_map_.try_emplace(origin, std::move(dict));
}
}