From 457d1b4490dbc293246f372532a81a9e90d366c4 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 20 Jul 2018 15:27:17 -0400 Subject: 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. --- src/common/logging/backend.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/common/logging/backend.h') diff --git a/src/common/logging/backend.h b/src/common/logging/backend.h index 57cdf6b2d..45609a535 100644 --- a/src/common/logging/backend.h +++ b/src/common/logging/backend.h @@ -7,6 +7,7 @@ #include #include #include +#include #include #include "common/file_util.h" #include "common/logging/filter.h" @@ -106,9 +107,9 @@ private: void AddBackend(std::unique_ptr 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 -- cgit v1.2.3 From 7a1a860abe6a6032353209a3df3841ee574877a8 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 20 Jul 2018 15:31:25 -0400 Subject: logging/backend: Add missing standard includes A few inclusions were being satisfied indirectly. To prevent breakages in the future, include these directly. --- src/common/logging/backend.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/common/logging/backend.h') diff --git a/src/common/logging/backend.h b/src/common/logging/backend.h index 45609a535..b3f4b9cef 100644 --- a/src/common/logging/backend.h +++ b/src/common/logging/backend.h @@ -4,11 +4,9 @@ #pragma once #include -#include #include #include #include -#include #include "common/file_util.h" #include "common/logging/filter.h" #include "common/logging/log.h" -- cgit v1.2.3