Merge pull request #2509 from kin4stat/v1.x

Replace iterator difference with std::distance(revert #2030)
This commit is contained in:
Gabi Melman 2022-10-15 00:41:16 +03:00 committed by GitHub
commit d011332616
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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); auto it = std::find(std::begin(level_string_views), std::end(level_string_views), name);
if (it != std::end(level_string_views)) 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.. // check also for "warn" and "err" before giving up..
if (name == "warn") if (name == "warn")