[Redirector] Optimize code

This commit is contained in:
Connection Refused
2021-10-14 18:42:17 +08:00
parent b4c368c057
commit 98f1db301b
2 changed files with 4 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
#include "Utils.h"
string ws2s(const wstring str)
string ws2s(wstring str)
{
auto length = WideCharToMultiByte(CP_ACP, 0, str.c_str(), static_cast<int>(str.length()), NULL, 0, NULL, NULL);
auto buffer = new char[length + 1]();
@@ -13,7 +13,7 @@ string ws2s(const wstring str)
return data;
}
wstring s2ws(const string str)
wstring s2ws(string str)
{
auto length = MultiByteToWideChar(CP_ACP, 0, str.c_str(), static_cast<int>(str.length()), NULL, 0);
auto buffer = new wchar_t[length + 1]();

View File

@@ -3,6 +3,6 @@
#define UTILS_H
#include "Based.h"
string ws2s(const wstring str);
wstring s2ws(const string str);
string ws2s(wstring str);
wstring s2ws(string str);
#endif