minor changes added const ref params

This commit is contained in:
semenov_gv 2021-10-18 19:06:05 +03:00 committed by gabime
parent 0c611af552
commit e3e4c4bc95
3 changed files with 5 additions and 5 deletions

View File

@ -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{};

View File

@ -99,11 +99,11 @@ SPDLOG_API void utf8_to_wstrbuf(string_view_t str, wmemory_buf_t &target);
// "abc/" => "abc"
// "abc" => ""
// "abc///" => "abc//"
SPDLOG_API filename_t dir_name(filename_t path);
SPDLOG_API filename_t dir_name(const filename_t &path);
// Create a dir from the given path.
// Return true if succeeded or if this dir already exists.
SPDLOG_API bool create_dir(filename_t path);
SPDLOG_API bool create_dir(const filename_t &path);
// non thread safe, cross platform getenv/getenv_s
// return empty string if field not found

View File

@ -68,7 +68,7 @@ class SPDLOG_API custom_flag_formatter : public details::flag_formatter
public:
virtual std::unique_ptr<custom_flag_formatter> clone() const = 0;
void set_padding_info(details::padding_info padding)
void set_padding_info(const details::padding_info& padding)
{
flag_formatter::padinfo_ = padding;
}