From f68521c4d001efdbd07dbe881d825a4bae78b868 Mon Sep 17 00:00:00 2001 From: rh101 Date: Sun, 25 Apr 2021 02:45:04 +1000 Subject: [PATCH] Minor code cleanup --- cocos/base/ZipUtils.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cocos/base/ZipUtils.cpp b/cocos/base/ZipUtils.cpp index 9521855eb1..4dc823290c 100644 --- a/cocos/base/ZipUtils.cpp +++ b/cocos/base/ZipUtils.cpp @@ -559,8 +559,6 @@ voidpf ZipFile_open_file_func(voidpf opaque, const char* filename, int mode) voidpf ZipFile_opendisk_file_func(voidpf opaque, voidpf stream, uint32_t number_disk, int mode) { - voidpf ret = nullptr; - if (stream == nullptr) return nullptr; @@ -575,10 +573,10 @@ voidpf ZipFile_opendisk_file_func(voidpf opaque, voidpf stream, uint32_t number_ snprintf(&extensionBuffer[0], 5, ".z%02u", number_disk + 1); diskFilename.replace(pos, 4, extensionBuffer); delete[] extensionBuffer; - ret = ZipFile_open_file_func(opaque, diskFilename.c_str(), mode); + return ZipFile_open_file_func(opaque, diskFilename.c_str(), mode); } - return ret; + return nullptr; } uint32_t ZipFile_read_file_func(voidpf opaque, voidpf stream, void* buf, uint32_t size)