mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:37:35 +00:00
Browser: Use String::count instead of String::replace(X, X, true)
There's no need to create a new String just to count the amount of occurrences of a substring.
This commit is contained in:
parent
6d2b003b6e
commit
aba4c9579f
1 changed files with 1 additions and 1 deletions
|
@ -280,7 +280,7 @@ void BrowserWindow::build_menus()
|
|||
return;
|
||||
}
|
||||
|
||||
int argument_count = search_engine.replace("{}", "{}", true);
|
||||
auto argument_count = search_engine.count("{}"sv);
|
||||
if (argument_count != 1) {
|
||||
GUI::MessageBox::show(this, "Invalid format, must contain '{}' once!", "Error", GUI::MessageBox::Type::Error);
|
||||
m_disable_search_engine_action->activate();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue