From ce23400cbd8cbe8c6a8712ae2ecf88d1053ebc99 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 1 Aug 2020 13:54:56 +0200 Subject: Use faster variant of std::string::find --- src/gui/BreadCrumbs.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/gui') diff --git a/src/gui/BreadCrumbs.cpp b/src/gui/BreadCrumbs.cpp index 33b2c4b3..d641f5ac 100644 --- a/src/gui/BreadCrumbs.cpp +++ b/src/gui/BreadCrumbs.cpp @@ -92,16 +92,16 @@ BreadCrumbs::build(Raul::Path path, SPtr view) if (suffix[0] == '/') { suffix = suffix.substr(1); } - const string name = suffix.substr(0, suffix.find("/")); + const string name = suffix.substr(0, suffix.find('/')); _full_path = _full_path.child(Raul::Symbol(name)); BreadCrumb* but = create_crumb(_full_path, view); pack_start(*but, false, false, 1); _breadcrumbs.push_back(but); but->show(); - if (suffix.find("/") == string::npos) { + if (suffix.find('/') == string::npos) { break; } else { - suffix = suffix.substr(suffix.find("/")+1); + suffix = suffix.substr(suffix.find('/') + 1); } } @@ -135,17 +135,17 @@ BreadCrumbs::build(Raul::Path path, SPtr view) if (suffix[0] == '/') { suffix = suffix.substr(1); } - const string name = suffix.substr(0, suffix.find("/")); + const string name = suffix.substr(0, suffix.find('/')); working_path = working_path.child(Raul::Symbol(name)); BreadCrumb* but = create_crumb(working_path, view); pack_start(*but, false, false, 1); _breadcrumbs.push_back(but); but->set_active(working_path == _active_path); but->show(); - if (suffix.find("/") == string::npos) { + if (suffix.find('/') == string::npos) { break; } else { - suffix = suffix.substr(suffix.find("/")+1); + suffix = suffix.substr(suffix.find('/')+1); } } } -- cgit v1.2.1