From 7999cacf1c8b0685f1a67795f698ac8732da1ebd Mon Sep 17 00:00:00 2001 From: psychon Date: Thu, 18 Feb 2010 12:49:24 +0000 Subject: [PATCH] Avoid a CString copy in CFile::FType() You guessed right, cppcheck ftw! git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1764 726aef4b-f618-498e-8847-2d620e286838 --- FileUtils.cpp | 2 +- FileUtils.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/FileUtils.cpp b/FileUtils.cpp index 9bbe6c06..0383ab48 100644 --- a/FileUtils.cpp +++ b/FileUtils.cpp @@ -72,7 +72,7 @@ bool CFile::IsLnk(bool bUseLstat) const { return CFile::IsLnk(m_sLongName, bUseL bool CFile::IsSock(bool bUseLstat) const { return CFile::IsSock(m_sLongName, bUseLstat); } // for gettin file types, using fstat instead -bool CFile::FType(const CString sFileName, EFileTypes eType, bool bUseLstat) { +bool CFile::FType(const CString& sFileName, EFileTypes eType, bool bUseLstat) { struct stat st; if (!bUseLstat) { diff --git a/FileUtils.h b/FileUtils.h index 0bca83bb..0348d4dd 100644 --- a/FileUtils.h +++ b/FileUtils.h @@ -53,7 +53,7 @@ public: bool IsSock(bool bUseLstat = false) const; // for gettin file types, using fstat instead - static bool FType(const CString sFileName, EFileTypes eType, bool bUseLstat = false); + static bool FType(const CString& sFileName, EFileTypes eType, bool bUseLstat = false); enum EFileAttr { FA_Name,