Use the more efficient character literal overload for find_first_of/find_last_of

Recommendation from Clang-Tidy: https://clang.llvm.org/extra/clang-tidy/checks/performance-faster-string-find.html
This commit is contained in:
scribam 2019-06-01 15:03:08 +02:00 committed by Ivan
parent 78c7ef3039
commit bf557ea6e6
3 changed files with 4 additions and 4 deletions

View file

@ -186,12 +186,12 @@ gs_frame::gs_frame(const QString& title, const QRect& geometry, const QIcon& app
//Get version by substringing VersionNumber-buildnumber-commithash to get just the part before the dash
std::string version = rpcs3::version.to_string();
version = version.substr(0 , version.find_last_of("-"));
version = version.substr(0 , version.find_last_of('-'));
//Add branch and commit hash to version on frame , unless it's master.
if ((rpcs3::get_branch().compare("master") != 0) && (rpcs3::get_branch().compare("HEAD") != 0))
{
version = version + "-" + rpcs3::version.to_string().substr((rpcs3::version.to_string().find_last_of("-") + 1), 8) + "-" + rpcs3::get_branch();
version = version + "-" + rpcs3::version.to_string().substr((rpcs3::version.to_string().find_last_of('-') + 1), 8) + "-" + rpcs3::get_branch();
}
m_windowTitle += qstr(" | " + version);