From 2ab4d295b07134ff7861de6c561584244569a9ed Mon Sep 17 00:00:00 2001 From: codereader Date: Sun, 29 Jan 2017 09:19:41 +0100 Subject: [PATCH] Use os::getExtension instead of the legacy path_get_extension function --- libs/os/path.h | 12 ------------ radiant/map/Map.cpp | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/libs/os/path.h b/libs/os/path.h index 8ebb03be8f..3949658385 100644 --- a/libs/os/path.h +++ b/libs/os/path.h @@ -137,18 +137,6 @@ inline const char* path_get_filename_start(const char* path) return path; } -/// \brief Returns a pointer to the first character of the file extension of \p path, or "" if not found. -/// O(n) -inline const char* path_get_extension(const char* path) -{ - const char* last_period = strrchr(path_get_filename_start(path), '.'); - if(last_period != 0) - { - return ++last_period; - } - return ""; -} - /** General utility functions for OS-related tasks */ namespace os diff --git a/radiant/map/Map.cpp b/radiant/map/Map.cpp index 46508d2225..3139e2df4a 100644 --- a/radiant/map/Map.cpp +++ b/radiant/map/Map.cpp @@ -194,7 +194,7 @@ MapFormatPtr Map::getFormatForFile(const std::string& filename) std::string gameType = GlobalGameManager().currentGame()->getKeyValue("type"); MapFormatPtr mapFormat = GlobalMapFormatManager().getMapFormatForGameType( - gameType, path_get_extension(filename.c_str())); + gameType, os::getExtension(filename)); ASSERT_MESSAGE(mapFormat != NULL, "map format not found for file " + filename);