From 2423881b28e6944b3f61fe70af6222ef0a75d59e Mon Sep 17 00:00:00 2001 From: "deanm@chromium.org" Date: Fri, 29 May 2009 13:11:36 +0000 Subject: Move a few functions commonly called with char* to StringPiece. In some cases this will avoid the implicit char* -> std::string conversion, object creation, and string copying. One of the biggest benefit is on Windows, where we can save some conversions in FilePath::AppendASCII. Review URL: http://codereview.chromium.org/113996 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17182 0039d316-1c4b-4281-b951-d872f2087c98 --- base/file_path.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'base/file_path.cc') diff --git a/base/file_path.cc b/base/file_path.cc index b1bf687..a00659e 100644 --- a/base/file_path.cc +++ b/base/file_path.cc @@ -252,12 +252,12 @@ FilePath FilePath::Append(const FilePath& component) const { return Append(component.value()); } -FilePath FilePath::AppendASCII(const std::string& component) const { +FilePath FilePath::AppendASCII(const StringPiece& component) const { DCHECK(IsStringASCII(component)); #if defined(OS_WIN) return Append(ASCIIToWide(component)); #elif defined(OS_POSIX) - return Append(component); + return Append(component.as_string()); #endif } -- cgit v1.1