Optimization: no need to loop the whole vector.
Gotta love the back call.
This commit is contained in:
@@ -428,8 +428,10 @@ bool ProfileManager::CreateLocalProfile( RString sName, RString &sProfileIDOut )
|
|||||||
int iMaxProfileNumber = -1;
|
int iMaxProfileNumber = -1;
|
||||||
vector<RString> vs;
|
vector<RString> vs;
|
||||||
GetLocalProfileIDs( vs );
|
GetLocalProfileIDs( vs );
|
||||||
for (RString const &s : vs)
|
if (vs.size() > 0)
|
||||||
iMaxProfileNumber = std::stoi( s );
|
{
|
||||||
|
iMaxProfileNumber = std::stoi(vs.back());
|
||||||
|
}
|
||||||
|
|
||||||
int iProfileNumber = iMaxProfileNumber + 1;
|
int iProfileNumber = iMaxProfileNumber + 1;
|
||||||
RString sProfileID = ssprintf( "%08d", iProfileNumber );
|
RString sProfileID = ssprintf( "%08d", iProfileNumber );
|
||||||
|
|||||||
Reference in New Issue
Block a user