Updated some code to use the STL

This commit is contained in:
Subv
2013-12-29 15:47:23 -05:00
parent d234d0f3d0
commit d30eecf4e4
2 changed files with 3 additions and 9 deletions

View File

@@ -54,15 +54,9 @@ void Utils::CreateDir( const std::string& Path )
#endif
}
void Utils::Reverse(char word[])
void Utils::Reverse(std::string& str)
{
int len = strlen(word);
for (int i = 0;i < len / 2; i++)
{
word[i] ^= word[len-i-1];
word[len-i-1] ^= word[i];
word[i] ^= word[len-i-1];
}
std::reverse(str.begin(), str.end());
}
Vector3 Utils::ToRecast(const Vector3& val )

View File

@@ -367,7 +367,7 @@ struct MmapTileHeader
class Utils
{
public:
static void Reverse(char word[]);
static void Reverse(std::string& str);
static Vector3 ToRecast(const Vector3& val );
static std::string GetAdtPath(const std::string& world, int x, int y);
static std::string FixModelPath(const std::string& path);