Skip to content

Commit

Permalink
Merge pull request #2509 from kin4stat/v1.x
Browse files Browse the repository at this point in the history
Replace iterator difference with std::distance(revert #2030)
  • Loading branch information
gabime authored Oct 14, 2022
2 parents 936697e + 93b9132 commit d011332
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/spdlog/common-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ SPDLOG_INLINE spdlog::level::level_enum from_str(const std::string &name) SPDLOG
{
auto it = std::find(std::begin(level_string_views), std::end(level_string_views), name);
if (it != std::end(level_string_views))
return static_cast<level::level_enum>(it - std::begin(level_string_views));
return static_cast<level::level_enum>(std::distance(std::begin(level_string_views), it));

// check also for "warn" and "err" before giving up..
if (name == "warn")
Expand Down

0 comments on commit d011332

Please sign in to comment.