summaryrefslogtreecommitdiff
path: root/include/namespace.h
diff options
context:
space:
mode:
authorvalmat <ufabiz@gmail.com>2014-04-10 13:04:34 +0600
committervalmat <ufabiz@gmail.com>2014-04-10 13:04:34 +0600
commit14b63ee87dde3688fea7e58fa25b73362117ae11 (patch)
tree0611b2d6ccc4edfb27e350f4925cbe169c2520a7 /include/namespace.h
parent1a6b709b8f732ea8a91b07a74f64928e0484b1f6 (diff)
Fixed problem with duplicate names ini entries.
Mentioned https://github.com/CopernicaMarketingSoftware/PHP-CPP/issues/64#issuecomment-39838004 Now in the case of duplication name of ini entriy the new value overrides the old one. Before was incorrect handling of this situation.
Diffstat (limited to 'include/namespace.h')
-rw-r--r--include/namespace.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/namespace.h b/include/namespace.h
index 645eace..468a423 100644
--- a/include/namespace.h
+++ b/include/namespace.h
@@ -52,7 +52,7 @@ protected:
* Ini entry defined by the extension
* @var list
*/
- std::list<std::shared_ptr<Ini>> _ini_entries;
+ std::set<std::shared_ptr<Ini>, Ini::Compare> _ini_entries;
public:
/**
@@ -172,7 +172,7 @@ public:
Namespace &add(Ini &&ini)
{
// and add it to the list of classes
- _ini_entries.push_back(std::unique_ptr<Ini>(new Ini(std::move(ini))));
+ _ini_entries.emplace(new Ini(std::move(ini)));
// allow chaining
return *this;
@@ -186,7 +186,7 @@ public:
Namespace &add(const Ini &ini)
{
// and add it to the list of classes
- _ini_entries.push_back(std::unique_ptr<Ini>(new Ini(ini)));
+ _ini_entries.emplace(new Ini(ini));
// allow chaining
return *this;