Merge pull request #15641 from mogemimi/add-missing-references

Add missing references to avoid unnecessary copies
This commit is contained in:
minggo 2016-05-17 10:28:08 +08:00
commit 601460682e
7 changed files with 8 additions and 8 deletions

View File

@ -383,7 +383,7 @@ public:
return header; return header;
} }
const std::string getCookieFileName() const std::string& getCookieFileName() const
{ {
return _cookieFileName; return _cookieFileName;
} }
@ -608,7 +608,7 @@ private:
return len; return len;
} }
const std::string getCookieString() const std::string& getCookieString() const
{ {
return _responseCookies; return _responseCookies;
} }

View File

@ -152,7 +152,7 @@ void HttpCookie::writeFile()
fclose(out); fclose(out);
} }
void HttpCookie::setCookieFileName(std::string filename) void HttpCookie::setCookieFileName(const std::string& filename)
{ {
_cookieFileName = filename; _cookieFileName = filename;
} }

View File

@ -46,7 +46,7 @@ public:
void readFile(); void readFile();
void writeFile(); void writeFile();
void setCookieFileName(const std::string fileName); void setCookieFileName(const std::string& fileName);
const std::vector<CookiesInfo>* getCookies()const; const std::vector<CookiesInfo>* getCookies()const;
const CookiesInfo* getMatchCookie(const std::string& url) const; const CookiesInfo* getMatchCookie(const std::string& url) const;

View File

@ -600,7 +600,7 @@ std::string TextureCache::getCachedTextureInfo() const
return buffer; return buffer;
} }
void TextureCache::renameTextureWithKey(const std::string srcName, const std::string dstName) void TextureCache::renameTextureWithKey(const std::string& srcName, const std::string& dstName)
{ {
std::string key = srcName; std::string key = srcName;
auto it = _textures.find(key); auto it = _textures.find(key);

View File

@ -212,7 +212,7 @@ public:
* *
* @since v3.10 * @since v3.10
*/ */
void renameTextureWithKey(const std::string srcName, const std::string dstName); void renameTextureWithKey(const std::string& srcName, const std::string& dstName);
private: private:

View File

@ -1691,7 +1691,7 @@ void RichText::handleTextRenderer(const std::string& text, const std::string& fo
} }
} }
void RichText::handleImageRenderer(const std::string& filePath, const Color3B &color, GLubyte opacity, int width, int height, const std::string url) void RichText::handleImageRenderer(const std::string& filePath, const Color3B &color, GLubyte opacity, int width, int height, const std::string& url)
{ {
Sprite* imageRenderer = Sprite::create(filePath); Sprite* imageRenderer = Sprite::create(filePath);
if (imageRenderer) if (imageRenderer)

View File

@ -553,7 +553,7 @@ protected:
const Color3B& outlineColor = Color3B::WHITE, int outlineSize = -1, const Color3B& outlineColor = Color3B::WHITE, int outlineSize = -1,
const Color3B& shadowColor = Color3B::BLACK, const cocos2d::Size& shadowOffset = Size(2.0, -2.0), int shadowBlurRadius = 0, const Color3B& shadowColor = Color3B::BLACK, const cocos2d::Size& shadowOffset = Size(2.0, -2.0), int shadowBlurRadius = 0,
const Color3B& glowColor = Color3B::WHITE); const Color3B& glowColor = Color3B::WHITE);
void handleImageRenderer(const std::string& fileParh, const Color3B& color, GLubyte opacity, int width, int height, const std::string url); void handleImageRenderer(const std::string& fileParh, const Color3B& color, GLubyte opacity, int width, int height, const std::string& url);
void handleCustomRenderer(Node* renderer); void handleCustomRenderer(Node* renderer);
void formarRenderers(); void formarRenderers();
void addNewLine(); void addNewLine();