summaryrefslogtreecommitdiff
path: root/src/Tree.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-09-11 07:10:31 (GMT)
committerMarius Kintel <marius@kintel.net>2011-09-11 07:10:31 (GMT)
commit18e97e0bd3f6bda4fdcd17de2a85173ba59b6b00 (patch)
tree327ec7c648e0f01a2673672ebe83c3524c971e19 /src/Tree.cc
parent9afeded46c0e9023002dc04ba6131adcb39762b1 (diff)
Fixed bug introduced by the new PolySet cache; string filtering done in the wrong place, refactored cache into separate class
Diffstat (limited to 'src/Tree.cc')
-rw-r--r--src/Tree.cc12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/Tree.cc b/src/Tree.cc
index 7615a3d..e791e12 100644
--- a/src/Tree.cc
+++ b/src/Tree.cc
@@ -4,16 +4,11 @@
#include <assert.h>
#include <algorithm>
-static bool filter(char c)
-{
- return c == ' ' || c == '\n' || c == '\t' || c == '\r';
-}
-
/*!
Returns the cached string representation of the subtree rooted by \a node.
If node is not cached, the cache will be rebuilt.
*/
-const std::string Tree::getString(const AbstractNode &node) const
+const std::string &Tree::getString(const AbstractNode &node) const
{
assert(this->root_node);
if (!this->nodecache.contains(node)) {
@@ -23,10 +18,7 @@ const std::string Tree::getString(const AbstractNode &node) const
assert(this->nodecache.contains(*this->root_node) &&
"NodeDumper failed to create a cache");
}
- std::string str = this->nodecache[node];
- str.erase(std::remove_if(str.begin(), str.end(), filter), str.end());
-
- return str;
+ return this->nodecache[node];
}
/*!
contact: Jan Huwald // Impressum