From 4f41b9d3ac25eeb924de43396b522e33807ef59b Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 28 Apr 2014 14:53:30 +0800 Subject: [PATCH] fullPathForFilename optimization: Checking whether the path is an empty string. --- cocos/2d/platform/CCFileUtils.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cocos/2d/platform/CCFileUtils.cpp b/cocos/2d/platform/CCFileUtils.cpp index c356a20af9..a19a88f0dc 100644 --- a/cocos/2d/platform/CCFileUtils.cpp +++ b/cocos/2d/platform/CCFileUtils.cpp @@ -680,6 +680,11 @@ std::string FileUtils::getPathForFilename(const std::string& filename, const std std::string FileUtils::fullPathForFilename(const std::string &filename) { + if (filename.empty()) + { + return ""; + } + if (isAbsolutePath(filename)) { return filename;