mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix: optimization: PVS-Studio warning V813
Passing large objects by const reference avoids unnecessary copying and enhances efficiency. Reported by: PVS-Studio Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
parent
5b325ac2bc
commit
2c1103307f
42 changed files with 173 additions and 144 deletions
|
|
@ -37,7 +37,7 @@ std::string util::quote(const std::string& s) {
|
|||
return escape(s);
|
||||
}
|
||||
|
||||
std::wstring util::lfill(std::wstring s, uint length, wchar_t c) {
|
||||
std::wstring util::lfill(const std::wstring& s, uint length, wchar_t c) {
|
||||
if (s.length() >= length) {
|
||||
return s;
|
||||
}
|
||||
|
|
@ -49,7 +49,7 @@ std::wstring util::lfill(std::wstring s, uint length, wchar_t c) {
|
|||
return ss.str();
|
||||
}
|
||||
|
||||
std::wstring util::rfill(std::wstring s, uint length, wchar_t c) {
|
||||
std::wstring util::rfill(const std::wstring& s, uint length, wchar_t c) {
|
||||
if (s.length() >= length) {
|
||||
return s;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue