From 54f84cc924eb609ad42ed26029256e058aed6b9d Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 6 Sep 2023 12:15:56 -0700 Subject: [PATCH] clang-tidy: use data() (#1129) Found with readability-container-data-pointer Signed-off-by: Rosen Penev --- taglib/toolkit/tdebuglistener.cpp | 4 ++-- taglib/toolkit/tiostream.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/taglib/toolkit/tdebuglistener.cpp b/taglib/toolkit/tdebuglistener.cpp index 6f9447f8..bc2f6c28 100644 --- a/taglib/toolkit/tdebuglistener.cpp +++ b/taglib/toolkit/tdebuglistener.cpp @@ -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 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 diff --git a/taglib/toolkit/tiostream.cpp b/taglib/toolkit/tiostream.cpp index f49526d3..f13ae9ee 100644 --- a/taglib/toolkit/tiostream.cpp +++ b/taglib/toolkit/tiostream.cpp @@ -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; }