From 738662338ff4c054b8ab09148448374930661423 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 8 Nov 2022 12:45:21 +0100 Subject: [PATCH 1/2] ApplyRule#GetFKVar(): return by const ref to avoid malloc(). --- lib/config/applyrule.cpp | 5 ----- lib/config/applyrule.hpp | 7 ++++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/config/applyrule.cpp b/lib/config/applyrule.cpp index 5cfbf9e35..86aed4a70 100644 --- a/lib/config/applyrule.cpp +++ b/lib/config/applyrule.cpp @@ -37,11 +37,6 @@ String ApplyRule::GetPackage() const return m_Package; } -String ApplyRule::GetFKVar() const -{ - return m_FKVar; -} - String ApplyRule::GetFVVar() const { return m_FVVar; diff --git a/lib/config/applyrule.hpp b/lib/config/applyrule.hpp index 6b6fca8f8..2e3f1d3f8 100644 --- a/lib/config/applyrule.hpp +++ b/lib/config/applyrule.hpp @@ -55,7 +55,12 @@ public: Expression::Ptr GetExpression() const; Expression::Ptr GetFilter() const; String GetPackage() const; - String GetFKVar() const; + + inline const String& GetFKVar() const noexcept + { + return m_FKVar; + } + String GetFVVar() const; Expression::Ptr GetFTerm() const; bool GetIgnoreOnError() const; From e97a5d59e0e3c542d7974cab90d554c98628fc67 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 8 Nov 2022 12:48:13 +0100 Subject: [PATCH 2/2] ApplyRule#GetFVVar(): return by const ref to avoid malloc(). --- lib/config/applyrule.cpp | 5 ----- lib/config/applyrule.hpp | 6 +++++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/config/applyrule.cpp b/lib/config/applyrule.cpp index 86aed4a70..46fc356f7 100644 --- a/lib/config/applyrule.cpp +++ b/lib/config/applyrule.cpp @@ -37,11 +37,6 @@ String ApplyRule::GetPackage() const return m_Package; } -String ApplyRule::GetFVVar() const -{ - return m_FVVar; -} - Expression::Ptr ApplyRule::GetFTerm() const { return m_FTerm; diff --git a/lib/config/applyrule.hpp b/lib/config/applyrule.hpp index 2e3f1d3f8..3db14f10c 100644 --- a/lib/config/applyrule.hpp +++ b/lib/config/applyrule.hpp @@ -61,7 +61,11 @@ public: return m_FKVar; } - String GetFVVar() const; + inline const String& GetFVVar() const noexcept + { + return m_FVVar; + } + Expression::Ptr GetFTerm() const; bool GetIgnoreOnError() const; DebugInfo GetDebugInfo() const;