Index: base/file_util.cc |
diff --git a/base/file_util.cc b/base/file_util.cc |
index 7cf67dd28e169dfb9bfdbeee2ecc1440419ed568..4748f5e20176d1714f40efdc6a242e8ef7fff2a6 100644 |
--- a/base/file_util.cc |
+++ b/base/file_util.cc |
@@ -47,15 +47,6 @@ bool EnsureEndsWithSeparator(FilePath* path) { |
return true; |
} |
-FilePath::StringType GetFileExtensionFromPath(const FilePath& path) { |
- FilePath::StringType file_name = path.BaseName().value(); |
- const FilePath::StringType::size_type last_dot = |
- file_name.rfind(kExtensionSeparator); |
- return FilePath::StringType(last_dot == FilePath::StringType::npos ? |
- FILE_PATH_LITERAL("") : |
- file_name, last_dot+1); |
-} |
- |
void InsertBeforeExtension(FilePath* path, const FilePath::StringType& suffix) { |
FilePath::StringType& value = |
const_cast<FilePath::StringType&>(path->value()); |
@@ -382,9 +373,10 @@ bool Delete(const std::wstring& path, bool recursive) { |
return Delete(FilePath::FromWStringHack(path), recursive); |
} |
std::wstring GetFileExtensionFromPath(const std::wstring& path) { |
- FilePath::StringType extension = |
- GetFileExtensionFromPath(FilePath::FromWStringHack(path)); |
- return extension; |
+ std::wstring file_name = FilePath(path).BaseName().value(); |
+ const std::wstring::size_type last_dot = file_name.rfind(kExtensionSeparator); |
+ return std::wstring(last_dot == std::wstring::npos ? L"" |
+ : file_name, last_dot + 1); |
} |
FILE* OpenFile(const std::wstring& filename, const char* mode) { |
return OpenFile(FilePath::FromWStringHack(filename), mode); |