summaryrefslogtreecommitdiff
path: root/src/nodecache.h
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2010-03-17 19:21:54 (GMT)
committerMarius Kintel <marius@kintel.net>2010-10-31 00:42:34 (GMT)
commitadb2d73da34927b450a95612cd6487867a77dd66 (patch)
tree4ec09575cc27d283c2049ef3cec8ab92f17e8e5c /src/nodecache.h
parent75cd0f291af8e1fd8e27cc649bf40bf291bb40f7 (diff)
bugfix: only resize if needed, else nodes get deleted
Diffstat (limited to 'src/nodecache.h')
-rw-r--r--src/nodecache.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nodecache.h b/src/nodecache.h
index c5a5524..943f904 100644
--- a/src/nodecache.h
+++ b/src/nodecache.h
@@ -17,7 +17,7 @@ public:
}
void insert(const class AbstractNode &node, const T & value) {
- this->cache.resize(node.index() + 1);
+ if (this->cache.size() <= node.index()) this->cache.resize(node.index() + 1);
this->cache[node.index()] = value;
}
contact: Jan Huwald // Impressum