diff options
author | Subv <subv2112@gmail.com> | 2013-12-29 15:47:23 -0500 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2013-12-29 15:47:23 -0500 |
commit | d30eecf4e4b7766b7f46b9ca3f0c6741b08d79af (patch) | |
tree | 964b61d604c58a59e4aac3fccbdb277a9b10734d /src | |
parent | d234d0f3d0889e799eb066ba39c9b1edbc964d6e (diff) |
Updated some code to use the STL
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/mesh_extractor/Utils.cpp | 10 | ||||
-rw-r--r-- | src/tools/mesh_extractor/Utils.h | 2 |
2 files changed, 3 insertions, 9 deletions
diff --git a/src/tools/mesh_extractor/Utils.cpp b/src/tools/mesh_extractor/Utils.cpp index c2a7577937a..0591c121895 100644 --- a/src/tools/mesh_extractor/Utils.cpp +++ b/src/tools/mesh_extractor/Utils.cpp @@ -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 ) diff --git a/src/tools/mesh_extractor/Utils.h b/src/tools/mesh_extractor/Utils.h index ad521852271..87b6a40582a 100644 --- a/src/tools/mesh_extractor/Utils.h +++ b/src/tools/mesh_extractor/Utils.h @@ -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); |