diff options
author | Lioncash <mathew1800@gmail.com> | 2018-07-20 15:27:17 -0400 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-07-20 15:27:20 -0400 |
commit | 457d1b4490dbc293246f372532a81a9e90d366c4 (patch) | |
tree | 93eb2026cadad03ab9d52be843a9446ff180ecf0 /src/common/logging/backend.h | |
parent | c1c9ab31e80a182d03765658191bfd3a6c8a691f (diff) |
logging/backend: Use std::string_view in RemoveBackend() and GetBackend()
These can just use a view to a string since its only comparing against
two names in both cases for matches. This avoids constructing
std::string instances where they aren't necessary.
Diffstat (limited to 'src/common/logging/backend.h')
-rw-r--r-- | src/common/logging/backend.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common/logging/backend.h b/src/common/logging/backend.h index 57cdf6b2de..45609a535c 100644 --- a/src/common/logging/backend.h +++ b/src/common/logging/backend.h @@ -7,6 +7,7 @@ #include <cstdarg> #include <memory> #include <string> +#include <string_view> #include <utility> #include "common/file_util.h" #include "common/logging/filter.h" @@ -106,9 +107,9 @@ private: void AddBackend(std::unique_ptr<Backend> backend); -void RemoveBackend(const std::string& backend_name); +void RemoveBackend(std::string_view backend_name); -Backend* GetBackend(const std::string& backend_name); +Backend* GetBackend(std::string_view backend_name); /** * Returns the name of the passed log class as a C-string. Subclasses are separated by periods |