1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-28 15:38:30 +02:00

Remove std::strings from levelZipCallback()

There's basically no reason to use heap-allocated strings here, so it's
all gone now.
This commit is contained in:
Misa 2021-02-26 16:03:56 -08:00 committed by Ethan Lee
parent 5d4c1b7e9d
commit 2aeb3f35ce

View File

@ -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())
);
}