diff options
author | Joerg Bornemann <joerg.bornemann@theqtcompany.com> | 2015-04-17 16:02:20 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@theqtcompany.com> | 2015-04-28 13:06:00 +0000 |
commit | 08170b040e304d3b4d5ac0448c7ecc5fbf87797a (patch) | |
tree | 387d88b46cd93d7ebf7b115b79c9270751d2200f /src/lib/corelib/buildgraph/nodeset.cpp | |
parent | ec6541543d82341179da035e0a93792a5d2187b9 (diff) |
make NodeSet implicitly shared
This enables us to use the foreach macro without deep-copying the
container.
Change-Id: I6eb5ff5874a5065ff4b89e6cbde2b78c6fb0a950
Task-number: QBS-778
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Diffstat (limited to 'src/lib/corelib/buildgraph/nodeset.cpp')
-rw-r--r-- | src/lib/corelib/buildgraph/nodeset.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/lib/corelib/buildgraph/nodeset.cpp b/src/lib/corelib/buildgraph/nodeset.cpp index c24af87d8..61cbbc9df 100644 --- a/src/lib/corelib/buildgraph/nodeset.cpp +++ b/src/lib/corelib/buildgraph/nodeset.cpp @@ -40,23 +40,19 @@ namespace qbs { namespace Internal { NodeSet::NodeSet() -{ -} - -NodeSet::NodeSet(const NodeSet &other) - : m_data(other.m_data) + : d(new NodeSetData) { } NodeSet &NodeSet::unite(const NodeSet &other) { - m_data.insert(other.begin(), other.end()); + d->m_data.insert(other.begin(), other.end()); return *this; } void NodeSet::remove(BuildGraphNode *node) { - m_data.erase(node); + d->m_data.erase(node); } void NodeSet::load(PersistentPool &pool) |