From 6784c8d10816c01c4d5d2f7249ce0c33372a0a30 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Fri, 31 Oct 2014 19:20:09 -0400 Subject: [PATCH] CLI - Made ::entity aware of whether an entity is already known, to avoid adding when not necessary. --- src/CLI.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/CLI.cpp b/src/CLI.cpp index a6c97f76e..13832459b 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -241,9 +241,10 @@ void CLI::alias (const std::string& name, const std::string& value) } //////////////////////////////////////////////////////////////////////////////// -void CLI::entity (const std::string& name, const std::string& value) +void CLI::entity (const std::string& category, const std::string& name) { - _entities.insert (std::pair (name, value)); + if (_entities.find (category) == _entities.end ()) + _entities.insert (std::pair (category, name)); } ////////////////////////////////////////////////////////////////////////////////