mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-30 18:39:03 +08:00
minor changes added const ref params
This commit is contained in:
@@ -542,7 +542,7 @@ static SPDLOG_INLINE bool mkdir_(const filename_t &path)
|
||||
|
||||
// create the given directory - and all directories leading to it
|
||||
// return true on success or if the directory already exists
|
||||
SPDLOG_INLINE bool create_dir(filename_t path)
|
||||
SPDLOG_INLINE bool create_dir(const filename_t &path)
|
||||
{
|
||||
if (path_exists(path))
|
||||
{
|
||||
@@ -581,7 +581,7 @@ SPDLOG_INLINE bool create_dir(filename_t path)
|
||||
// "abc/" => "abc"
|
||||
// "abc" => ""
|
||||
// "abc///" => "abc//"
|
||||
SPDLOG_INLINE filename_t dir_name(filename_t path)
|
||||
SPDLOG_INLINE filename_t dir_name(const filename_t &path)
|
||||
{
|
||||
auto pos = path.find_last_of(folder_seps_filename);
|
||||
return pos != filename_t::npos ? path.substr(0, pos) : filename_t{};
|
||||
|
Reference in New Issue
Block a user