From 2aeb3f35ce2f2811d647e52f67fe51f03fda11c1 Mon Sep 17 00:00:00 2001 From: Misa Date: Fri, 26 Feb 2021 16:03:56 -0800 Subject: [PATCH] Remove std::strings from levelZipCallback() There's basically no reason to use heap-allocated strings here, so it's all gone now. --- desktop_version/src/editor.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/desktop_version/src/editor.cpp b/desktop_version/src/editor.cpp index 1d9d25ba..743aed5d 100644 --- a/desktop_version/src/editor.cpp +++ b/desktop_version/src/editor.cpp @@ -80,17 +80,15 @@ static bool compare_nocase (std::string first, std::string second) static void levelZipCallback(const char* filename) { - std::string filename_ = filename; - - if (endsWith(filename_.c_str(), ".zip")) + if (endsWith(filename, ".zip")) { - PHYSFS_File* zip = PHYSFS_openRead(filename_.c_str()); + PHYSFS_File* zip = PHYSFS_openRead(filename); - if (!PHYSFS_mountHandle(zip, filename_.c_str(), "levels", 1)) + if (!PHYSFS_mountHandle(zip, filename, "levels", 1)) { printf( "Could not mount %s: %s\n", - filename_.c_str(), + filename, PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) ); }