From f0a1379e5a9ebc954e95d07c1ad5d71587adc6bc Mon Sep 17 00:00:00 2001 From: est31 Date: Fri, 17 Apr 2015 06:10:30 +0200 Subject: Refactor around translatePassword Change types for passed password from wstring to string, which removes converting back and forth in most cases. Move the narrow_to_wide conversion, where its neccessary, closer to irrlicht. Remove trailing spaces in guiPasswordChange.cpp. Make parameters for translatePassword passed as const reference. --- src/script/lua_api/l_util.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/script/lua_api/l_util.cpp') diff --git a/src/script/lua_api/l_util.cpp b/src/script/lua_api/l_util.cpp index 79a5b252a..0464f46d9 100644 --- a/src/script/lua_api/l_util.cpp +++ b/src/script/lua_api/l_util.cpp @@ -255,8 +255,7 @@ int ModApiUtil::l_get_password_hash(lua_State *L) NO_MAP_LOCK_REQUIRED; std::string name = luaL_checkstring(L, 1); std::string raw_password = luaL_checkstring(L, 2); - std::string hash = translatePassword(name, - narrow_to_wide(raw_password)); + std::string hash = translatePassword(name, raw_password); lua_pushstring(L, hash.c_str()); return 1; } -- cgit v1.2.3