From c25e24017cf0ff4a3b23e2f1b407d41c33ad17d3 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Tue, 13 Sep 2011 01:30:36 +0700 Subject: [PATCH] CString should be const& in parameters. Especially when it's not copied inside the function. --- User.cpp | 2 +- User.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/User.cpp b/User.cpp index cd6269dc..ec39937f 100644 --- a/User.cpp +++ b/User.cpp @@ -464,7 +464,7 @@ void CUser::RemoveNetwork(CIRCNetwork *pNetwork) { } } -bool CUser::DeleteNetwork(CString sNetwork) { +bool CUser::DeleteNetwork(const CString& sNetwork) { CIRCNetwork *pNetwork = FindNetwork(sNetwork); if (pNetwork) { diff --git a/User.h b/User.h index f20dfb91..02773e3a 100644 --- a/User.h +++ b/User.h @@ -67,7 +67,7 @@ public: // Networks CIRCNetwork* AddNetwork(const CString &sNetwork); - bool DeleteNetwork(CString sNetwork); + bool DeleteNetwork(const CString& sNetwork); bool AddNetwork(CIRCNetwork *pNetwork); void RemoveNetwork(CIRCNetwork *pNetwork); CIRCNetwork* FindNetwork(const CString& sNetwork);