summaryrefslogtreecommitdiff
path: root/src/nodecache.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nodecache.h')
-rw-r--r--src/nodecache.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nodecache.h b/src/nodecache.h
index cc3355e..61afe3e 100644
--- a/src/nodecache.h
+++ b/src/nodecache.h
@@ -25,9 +25,10 @@ public:
else return this->nullvalue;
}
- void insert(const class AbstractNode &node, const std::string & value) {
+ /*! Returns a reference to the cached string copy */
+ const std::string &insert(const class AbstractNode &node, const std::string & value) {
if (this->cache.size() <= node.index()) this->cache.resize(node.index() + 1);
- this->cache[node.index()] = value;
+ return this->cache[node.index()] = value;
}
void remove(const class AbstractNode &node) {
contact: Jan Huwald // Impressum