From 5000873778c1f0064e7b3900858b525ccf383c59 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 14 Apr 2014 10:01:17 +0800 Subject: [PATCH] Const love: std::function -> const std::function& --- cocos/2d/CCTextureCache.cpp | 2 +- cocos/2d/CCTextureCache.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/2d/CCTextureCache.cpp b/cocos/2d/CCTextureCache.cpp index 029df4218a..d384a1da30 100644 --- a/cocos/2d/CCTextureCache.cpp +++ b/cocos/2d/CCTextureCache.cpp @@ -93,7 +93,7 @@ std::string TextureCache::getDescription() const return StringUtils::format("", static_cast(_textures.size())); } -void TextureCache::addImageAsync(const std::string &path, std::function callback) +void TextureCache::addImageAsync(const std::string &path, const std::function& callback) { Texture2D *texture = nullptr; diff --git a/cocos/2d/CCTextureCache.h b/cocos/2d/CCTextureCache.h index 39b1a8e957..7f3cfb86f1 100644 --- a/cocos/2d/CCTextureCache.h +++ b/cocos/2d/CCTextureCache.h @@ -117,7 +117,7 @@ public: * Supported image extensions: .png, .jpg * @since v0.8 */ - virtual void addImageAsync(const std::string &filepath, std::function callback); + virtual void addImageAsync(const std::string &filepath, const std::function& callback); /** Returns a Texture2D object given an Image. * If the image was not previously loaded, it will create a new Texture2D object and it will return it.