summaryrefslogtreecommitdiffstats
path: root/src/crush
diff options
context:
space:
mode:
Diffstat (limited to 'src/crush')
-rw-r--r--src/crush/CrushCompiler.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/crush/CrushCompiler.cc b/src/crush/CrushCompiler.cc
index 44d94a25221..22e59134899 100644
--- a/src/crush/CrushCompiler.cc
+++ b/src/crush/CrushCompiler.cc
@@ -19,6 +19,7 @@
#include <typeinfo>
#include "common/errno.h"
+#include <boost/algorithm/string.hpp>
// -------------
@@ -332,11 +333,7 @@ int CrushCompiler::decompile(ostream &out)
string CrushCompiler::string_node(node_t &node)
{
- string s = string(node.value.begin(), node.value.end());
- while (s.length() > 0 &&
- s[0] == ' ')
- s = string(s.begin() + 1, s.end());
- return s;
+ return boost::trim_copy(string(node.value.begin(), node.value.end()));
}
int CrushCompiler::int_node(node_t &node)