From adba10c393460b7871b2dce5e3aeef60535270a1 Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Wed, 6 Sep 2017 15:33:03 +0200 Subject: [PATCH] allow overrides in environment variables --- alib2cli/src/environment/Environment.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/alib2cli/src/environment/Environment.h b/alib2cli/src/environment/Environment.h index 60a64c7ffc..6edac91dd3 100644 --- a/alib2cli/src/environment/Environment.h +++ b/alib2cli/src/environment/Environment.h @@ -30,8 +30,8 @@ public: throw exception::CommonException ( "Binded value of name " + name + " not found." ); } - bool setBinding ( std::string name, std::string value ) { - return m_bindings.insert ( std::make_pair ( std::move ( name ), std::move ( value ) ) ).second; + void setBinding ( std::string name, std::string value ) { + m_bindings [ std::move ( name ) ] = std::move ( value ); } bool clearBinding ( const std::string & name ) { @@ -50,8 +50,8 @@ public: throw exception::CommonException ( "Variable of name " + name + " not found." ); } - bool setVariable ( std::string name, std::shared_ptr < abstraction::OperationAbstraction > value ) { - return m_variables.insert ( std::make_pair ( std::move ( name ), std::move ( value ) ) ).second; + void setVariable ( std::string name, std::shared_ptr < abstraction::OperationAbstraction > value ) { + m_variables [ std::move ( name ) ] = std::move ( value ); } bool clearVariable ( const std::string & name ) { -- GitLab