clang-tidy: use data() (#1129)

Found with readability-container-data-pointer

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2023-09-06 12:15:56 -07:00 committed by GitHub
parent 47c4e0859c
commit 54f84cc924
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -47,9 +47,9 @@ namespace
const int len = WideCharToMultiByte(CP_ACP, 0, wstr.c_str(), -1, nullptr, 0, nullptr, nullptr);
if(len != 0) {
std::vector<char> buf(len);
WideCharToMultiByte(CP_ACP, 0, wstr.c_str(), -1, &buf[0], len, nullptr, nullptr);
WideCharToMultiByte(CP_ACP, 0, wstr.c_str(), -1, buf.data(), len, nullptr, nullptr);
std::cerr << std::string(&buf[0]);
std::cerr << std::string(buf.begin(), buf.end());
}
#else

View File

@ -43,7 +43,7 @@ namespace
return std::wstring();
std::wstring wstr(len - 1, L'\0');
MultiByteToWideChar(CP_ACP, 0, str, -1, &wstr[0], len);
MultiByteToWideChar(CP_ACP, 0, str, -1, wstr.data(), len);
return wstr;
}