diff options
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | 2012-02-08 11:49:22 +0100 |
---|---|---|
committer | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | 2012-02-24 23:26:14 +0100 |
commit | abab3db23d3d6e6fd3d51555ab355110a6e0540f (patch) | |
tree | b430e1bcd7e91e81f85828cd4ef262c110211c7c | |
parent | 496451c164af0b2e90c5b7a155a101ed55472e52 (diff) | |
download | minetest-abab3db23d3d6e6fd3d51555ab355110a6e0540f.tar.gz minetest-abab3db23d3d6e6fd3d51555ab355110a6e0540f.tar.bz2 minetest-abab3db23d3d6e6fd3d51555ab355110a6e0540f.zip |
tile: don't duplicate std::string::find_last_of
-rw-r--r-- | src/tile.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/tile.cpp b/src/tile.cpp index bc4c49cb1..0fa2e1029 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -1023,15 +1023,9 @@ video::IImage* generate_image_from_scratch(std::string name, char separator = '^'; // Find last meta separator in name - s32 last_separator_position = -1; - for(s32 i=name.size()-1; i>=0; i--) - { - if(name[i] == separator) - { - last_separator_position = i; - break; - } - } + s32 last_separator_position = name.find_last_of(separator); + //if(last_separator_position == std::npos) + // last_separator_position = -1; /*infostream<<"generate_image_from_scratch(): " <<"last_separator_position="<<last_separator_position |