tile: don't duplicate std::string::find_last_of
This commit is contained in:
parent
496451c164
commit
abab3db23d
12
src/tile.cpp
12
src/tile.cpp
|
@ -1023,15 +1023,9 @@ video::IImage* generate_image_from_scratch(std::string name,
|
||||||
char separator = '^';
|
char separator = '^';
|
||||||
|
|
||||||
// Find last meta separator in name
|
// Find last meta separator in name
|
||||||
s32 last_separator_position = -1;
|
s32 last_separator_position = name.find_last_of(separator);
|
||||||
for(s32 i=name.size()-1; i>=0; i--)
|
//if(last_separator_position == std::npos)
|
||||||
{
|
// last_separator_position = -1;
|
||||||
if(name[i] == separator)
|
|
||||||
{
|
|
||||||
last_separator_position = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*infostream<<"generate_image_from_scratch(): "
|
/*infostream<<"generate_image_from_scratch(): "
|
||||||
<<"last_separator_position="<<last_separator_position
|
<<"last_separator_position="<<last_separator_position
|
||||||
|
|
Loading…
Reference in New Issue