common/file_system: make GetFileNameFromPath file-local
GetFileNameFromPath has only two callers and both are inside file_system.cpp itself (GetDisplayNameFromPath at line 218 and GetFileTitleFromPath at line 232). No code outside the TU references it. Mark it static and drop the header declaration - the rest of the tree never needed to see this symbol. GetLastSeperatorPosition next to it (line 196) is already a file-local static for exactly the same reason, so this matches the surrounding style. Build: Makefile.libretro platform=unix - clean. swanstation_libretro.so size: 8020440 -> 8020336 bytes (-104, one fewer entry in dynsym). retro_* exports: 25 (unchanged).
This commit is contained in:
parent
46f4d9228d
commit
a96e66a86e
2 changed files with 6 additions and 9 deletions
|
|
@ -213,12 +213,7 @@ static std::string_view::size_type GetLastSeperatorPosition(const std::string_vi
|
|||
return last_separator;
|
||||
}
|
||||
|
||||
std::string GetDisplayNameFromPath(const std::string_view& path)
|
||||
{
|
||||
return std::string(GetFileNameFromPath(path));
|
||||
}
|
||||
|
||||
std::string_view GetFileNameFromPath(const std::string_view& path)
|
||||
static std::string_view GetFileNameFromPath(const std::string_view& path)
|
||||
{
|
||||
std::string_view::size_type pos = GetLastSeperatorPosition(path, true);
|
||||
if (pos == std::string_view::npos)
|
||||
|
|
@ -227,6 +222,11 @@ std::string_view GetFileNameFromPath(const std::string_view& path)
|
|||
return path.substr(pos);
|
||||
}
|
||||
|
||||
std::string GetDisplayNameFromPath(const std::string_view& path)
|
||||
{
|
||||
return std::string(GetFileNameFromPath(path));
|
||||
}
|
||||
|
||||
std::string_view GetFileTitleFromPath(const std::string_view& path)
|
||||
{
|
||||
std::string_view filename(GetFileNameFromPath(path));
|
||||
|
|
|
|||
|
|
@ -54,9 +54,6 @@ std::string ReplaceExtension(const std::string_view& path, const std::string_vie
|
|||
/// where it resolves a content URI to its name.
|
||||
std::string GetDisplayNameFromPath(const std::string_view& path);
|
||||
|
||||
/// Returns the filename component of a filename.
|
||||
std::string_view GetFileNameFromPath(const std::string_view& path);
|
||||
|
||||
/// Returns the file title (less the extension and path) from a filename.
|
||||
std::string_view GetFileTitleFromPath(const std::string_view& path);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue