From 51d5c8bcabe3fa9e9246c25e8b7f93cf73de231a Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 27 Jun 2021 01:48:19 +0200 Subject: [PATCH] Clang-tidy: performance-unnecessary-value-param --- Source/DiabloUI/dialogs.cpp | 2 +- Source/DiabloUI/dialogs.h | 2 +- Source/utils/soundsample.cpp | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/DiabloUI/dialogs.cpp b/Source/DiabloUI/dialogs.cpp index 862869cbf..f88346754 100644 --- a/Source/DiabloUI/dialogs.cpp +++ b/Source/DiabloUI/dialogs.cpp @@ -299,7 +299,7 @@ void UiErrorOkDialog(const char *text, const char *caption, bool error) UiOkDialog(text, caption, error, vecNULL); } -void UiErrorOkDialog(const char *text, std::vector renderBehind) +void UiErrorOkDialog(const char *text, const std::vector& renderBehind) { UiErrorOkDialog(text, nullptr, std::move(renderBehind)); } diff --git a/Source/DiabloUI/dialogs.h b/Source/DiabloUI/dialogs.h index eeb5fc5ae..cfb5d68b6 100644 --- a/Source/DiabloUI/dialogs.h +++ b/Source/DiabloUI/dialogs.h @@ -6,7 +6,7 @@ namespace devilution { -void UiErrorOkDialog(const char *text, std::vector renderBehind); +void UiErrorOkDialog(const char *text, const std::vector& renderBehind); void UiErrorOkDialog(const char *text, const char *caption, const std::vector &renderBehind); void UiOkDialog(const char *text, const char *caption, bool error, const std::vector &renderBehind); diff --git a/Source/utils/soundsample.cpp b/Source/utils/soundsample.cpp index c2ba0587d..2e0a08e41 100644 --- a/Source/utils/soundsample.cpp +++ b/Source/utils/soundsample.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -136,7 +137,7 @@ int SoundSample::SetChunkStream(std::string filePath) #ifndef STREAM_ALL_AUDIO int SoundSample::SetChunk(ArraySharedPtr fileData, std::size_t dwBytes) { - file_data_ = fileData; + file_data_ = std::move(fileData); file_data_size_ = dwBytes; SDL_RWops *buf = SDL_RWFromConstMem(file_data_.get(), dwBytes); if (buf == nullptr) {