From 59b4e2c97ec8b4c34e8d0205cf5e0f457b3f11a2 Mon Sep 17 00:00:00 2001 From: Flakebi Date: Fri, 24 Apr 2015 01:16:00 +0200 Subject: [PATCH] Clean some string code --- src/karts/kart_properties.hpp | 2 +- src/utils/string_utils.cpp | 7 ++++--- src/utils/string_utils.hpp | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/karts/kart_properties.hpp b/src/karts/kart_properties.hpp index f8268eb36..4f929e97b 100644 --- a/src/karts/kart_properties.hpp +++ b/src/karts/kart_properties.hpp @@ -458,7 +458,7 @@ public: */ core::stringw getName() const { - return core::stringw(translations->w_gettext(m_name.c_str())); + return _LTR(m_name.c_str()); } // ------------------------------------------------------------------------ diff --git a/src/utils/string_utils.cpp b/src/utils/string_utils.cpp index dd92b8c0e..65d4c9612 100644 --- a/src/utils/string_utils.cpp +++ b/src/utils/string_utils.cpp @@ -25,12 +25,13 @@ #include "coreutil.h" -#include #include +#include +#include +#include #include -#include +#include #include -#include namespace StringUtils { diff --git a/src/utils/string_utils.hpp b/src/utils/string_utils.hpp index 0c0f7d29c..00ef946d7 100644 --- a/src/utils/string_utils.hpp +++ b/src/utils/string_utils.hpp @@ -175,6 +175,7 @@ namespace StringUtils std::string insertValues(const std::string &s, Args ...args) { std::vector all_vals; + all_vals.reserve(sizeof...(args)); __FillStringVector::__FillS(all_vals, std::forward(args)...); return insertValues(s, all_vals); } @@ -190,6 +191,7 @@ namespace StringUtils irr::core::stringw insertValues(const irr::core::stringw &s, Args ...args) { std::vector all_vals; + all_vals.reserve(sizeof...(args)); __FillStringVector::__FillW(all_vals, std::forward(args)...); return insertValues(s, all_vals); }