diff --git a/src/browsedialog.cpp b/src/browsedialog.cpp index c544da1..dd1a15d 100644 --- a/src/browsedialog.cpp +++ b/src/browsedialog.cpp @@ -185,7 +185,7 @@ void BrowseDialog::directoryUp() p = path.rfind("/", p - 1); } - if (p == string::npos || path.compare(0, 1, "/") != 0 || path.length() < 2) { + if (p == string::npos || path.length() < 2 || path[0] != '/') { quit(); } else { selected = 0; diff --git a/src/menu.cpp b/src/menu.cpp index 7072633..b8a2a6a 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -545,7 +545,7 @@ void Menu::deleteSelectedLink() !icon_used && section::iterator link = section->begin(); !icon_used && linkend(); link++) - icon_used = !iconpath.compare((*link)->getIconPath()); + icon_used = iconpath == (*link)->getIconPath(); if (!icon_used) gmenu2x->sc.del(iconpath); @@ -694,7 +694,7 @@ void Menu::openPackage(std::string path, bool order) pos = metadata.rfind('.'); metadata = metadata.substr(pos + 1); - if (!metadata.compare(PLATFORM) || !metadata.compare("all")) { + if (metadata == PLATFORM || metadata == "all") { has_metadata = true; break; } diff --git a/src/selector.cpp b/src/selector.cpp index 359a8cf..be7fd80 100644 --- a/src/selector.cpp +++ b/src/selector.cpp @@ -176,7 +176,7 @@ int Selector::exec(int startSelection) { case InputManager::LEFT: if (link->getSelectorBrowser()) { string::size_type p = dir.rfind("/", dir.size()-2); - if (p==string::npos || dir.compare(0, 1, "/") != 0 || dir.length() < 2) { + if (p==string::npos || dir.length() < 2 || dir[0] != '/') { close = true; result = false; } else {