1
0
Fork 0

Codefix: move or pass by reference instead of copy

pull/13807/head
Rubidium 2025-03-13 20:28:29 +01:00 committed by rubidium42
parent 754311a779
commit 18e1440947
3 changed files with 3 additions and 3 deletions

View File

@ -454,7 +454,7 @@ static bool RealMakeScreenshot(ScreenshotType t, const std::string &name, uint32
* @return true iff the screenshot was successfully made.
* @see MakeScreenshotWithConfirm
*/
bool MakeScreenshot(ScreenshotType t, std::string name, uint32_t width, uint32_t height)
bool MakeScreenshot(ScreenshotType t, const std::string &name, uint32_t width, uint32_t height)
{
if (t == SC_CRASHLOG) {
/* Video buffer might or might not be locked. */

View File

@ -26,7 +26,7 @@ enum ScreenshotType : uint8_t {
void SetupScreenshotViewport(ScreenshotType t, struct Viewport *vp, uint32_t width = 0, uint32_t height = 0);
bool MakeHeightmapScreenshot(const char *filename);
void MakeScreenshotWithConfirm(ScreenshotType t);
bool MakeScreenshot(ScreenshotType t, std::string name, uint32_t width = 0, uint32_t height = 0);
bool MakeScreenshot(ScreenshotType t, const std::string &name, uint32_t width = 0, uint32_t height = 0);
bool MakeMinimapWorldScreenshot();
extern std::string _screenshot_format_name;

View File

@ -91,7 +91,7 @@ bool ScriptAdminMakeJSON(nlohmann::json &json, HSQUIRRELVM vm, SQInteger index,
return false;
}
json[key] = std::move(value);
json[std::move(key)] = std::move(value);
}
sq_pop(vm, 1);
return true;