mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
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:
@@ -67,7 +67,7 @@ void AtomJavaScriptDialogManager::RunJavaScriptDialog(
|
||||
|
||||
std::vector<std::string> buttons = {"OK"};
|
||||
if (dialog_type == JavaScriptDialogType::JAVASCRIPT_DIALOG_TYPE_CONFIRM) {
|
||||
buttons.push_back("Cancel");
|
||||
buttons.emplace_back("Cancel");
|
||||
// First button is default, second button is cancel
|
||||
default_id = 0;
|
||||
cancel_id = 1;
|
||||
|
||||
Reference in New Issue
Block a user