refactor: apply some 'clang-tidy -fix' changes (#20172)
* refactor: fix clang-tidy vector operation warnings Fix vector population performance-inefficient-vector-operation warnings generated by clang-tidy * refactor: fix clang-tidy emplace_back warnings In cases where a temporary is created to be passed to push_back(), replace it with emplace_back(). Warning: modernize-use-emplace * refactor: fix clang-tidy loop iteration warnings When practical, use range-based for loops instead of C-style for loops. clang-tiny check: modernize-loop-convert * refactor: fix clang-tidy string initialize warning Remove redundant empty string initialization. clang-tidy check: readability-redundant-string-init
This commit is contained in:
parent
3ec17a88ba
commit
b2652beceb
19 changed files with 62 additions and 69 deletions
|
@ -48,16 +48,14 @@ void ConvertFilters(const Filters& filters,
|
|||
}
|
||||
|
||||
buffer->reserve(filters.size() * 2);
|
||||
for (size_t i = 0; i < filters.size(); ++i) {
|
||||
const Filter& filter = filters[i];
|
||||
|
||||
for (const Filter& filter : filters) {
|
||||
COMDLG_FILTERSPEC spec;
|
||||
buffer->push_back(base::UTF8ToWide(filter.first));
|
||||
spec.pszName = buffer->back().c_str();
|
||||
|
||||
std::vector<std::string> extensions(filter.second);
|
||||
for (size_t j = 0; j < extensions.size(); ++j)
|
||||
extensions[j].insert(0, "*.");
|
||||
for (std::string& extension : extensions)
|
||||
extension.insert(0, "*.");
|
||||
buffer->push_back(base::UTF8ToWide(base::JoinString(extensions, ";")));
|
||||
spec.pszSpec = buffer->back().c_str();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue