Clean some string code

This commit is contained in:
Flakebi 2015-04-24 01:16:00 +02:00
parent 53164e5cbe
commit 59b4e2c97e
3 changed files with 7 additions and 4 deletions

View File

@ -458,7 +458,7 @@ public:
*/ */
core::stringw getName() const core::stringw getName() const
{ {
return core::stringw(translations->w_gettext(m_name.c_str())); return _LTR(m_name.c_str());
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------

View File

@ -25,12 +25,13 @@
#include "coreutil.h" #include "coreutil.h"
#include <math.h>
#include <algorithm> #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring> #include <cstring>
#include <stdio.h> #include <cwchar>
#include <exception> #include <exception>
#include <assert.h>
namespace StringUtils namespace StringUtils
{ {

View File

@ -175,6 +175,7 @@ namespace StringUtils
std::string insertValues(const std::string &s, Args ...args) std::string insertValues(const std::string &s, Args ...args)
{ {
std::vector<std::string> all_vals; std::vector<std::string> all_vals;
all_vals.reserve(sizeof...(args));
__FillStringVector::__FillS(all_vals, std::forward<Args>(args)...); __FillStringVector::__FillS(all_vals, std::forward<Args>(args)...);
return insertValues(s, all_vals); return insertValues(s, all_vals);
} }
@ -190,6 +191,7 @@ namespace StringUtils
irr::core::stringw insertValues(const irr::core::stringw &s, Args ...args) irr::core::stringw insertValues(const irr::core::stringw &s, Args ...args)
{ {
std::vector<irr::core::stringw> all_vals; std::vector<irr::core::stringw> all_vals;
all_vals.reserve(sizeof...(args));
__FillStringVector::__FillW(all_vals, std::forward<Args>(args)...); __FillStringVector::__FillW(all_vals, std::forward<Args>(args)...);
return insertValues(s, all_vals); return insertValues(s, all_vals);
} }