From: Jonathan Neuschäfer Date: Wed, 8 Feb 2012 10:49:22 +0000 (+0100) Subject: tile: don't duplicate std::string::find_last_of X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=abab3db23d3d6e6fd3d51555ab355110a6e0540f;p=zefram%2Fminetest%2Fminetest_engine.git tile: don't duplicate std::string::find_last_of --- diff --git a/src/tile.cpp b/src/tile.cpp index bc4c49cb..0fa2e102 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="<