mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Recast: use emplace_back
Avoid std::string copy, construct it in place.
This commit is contained in:
parent
0a0eeca20a
commit
1e1fe1beff
@ -35,7 +35,7 @@ void scanDirectoryAppend(const string& path, const string& ext, vector<string>&
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
filelist.push_back(dir.name);
|
filelist.emplace_back(dir.name);
|
||||||
}
|
}
|
||||||
while (_findnext(fh, &dir) == 0);
|
while (_findnext(fh, &dir) == 0);
|
||||||
_findclose(fh);
|
_findclose(fh);
|
||||||
@ -53,7 +53,7 @@ void scanDirectoryAppend(const string& path, const string& ext, vector<string>&
|
|||||||
int len = strlen(current->d_name);
|
int len = strlen(current->d_name);
|
||||||
if (len > extLen && strncmp(current->d_name + len - extLen, ext.c_str(), extLen) == 0)
|
if (len > extLen && strncmp(current->d_name + len - extLen, ext.c_str(), extLen) == 0)
|
||||||
{
|
{
|
||||||
filelist.push_back(current->d_name);
|
filelist.emplace_back(current->d_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir(dp);
|
closedir(dp);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user