Skip to content

Commit

Permalink
use std::string::find_last_not_of
Browse files Browse the repository at this point in the history
  • Loading branch information
soyersoyer committed Dec 30, 2024
1 parent 5b32756 commit 3726cb7
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/performanceconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1097,14 +1097,7 @@ std::string CPerformanceConfig::GetNewPerformanceDefaultName(void)

void CPerformanceConfig::SetNewPerformanceName(const std::string &Name)
{
int i = Name.length();
do
{
--i;
}
while (i >= 0 && Name[i] == 32);

NewPerformanceName = Name.substr(0, i + 1);
NewPerformanceName = Name.substr(0, Name.find_last_not_of(' ') + 1);
}

bool CPerformanceConfig::DeletePerformance(unsigned nID)
Expand Down

0 comments on commit 3726cb7

Please sign in to comment.