summaryrefslogtreecommitdiffstats
path: root/src/crush
diff options
context:
space:
mode:
authorSage Weil <sage@redhat.com>2016-01-13 03:23:45 +0100
committerSage Weil <sage@redhat.com>2016-01-13 03:23:45 +0100
commit7babda42fc7f6680a2f678ae1b9b83b9d62e6ce0 (patch)
treef9a2b58ab1eb015544ce5fb79846ed7ca9d0deb0 /src/crush
parentMerge pull request #6944 from linuxbox2/wip-civetwarn (diff)
parentCrush:Remove all the before and after space in better way. (diff)
downloadceph-7babda42fc7f6680a2f678ae1b9b83b9d62e6ce0.tar.xz
ceph-7babda42fc7f6680a2f678ae1b9b83b9d62e6ce0.zip
Merge pull request #7157 from songbaisen/song3
crush: clean up whitespace removal Reviewed-by: Sage Weil <sage@redhat.com> Reviewed-by: Kefu Chai <kchai@redhat.com>
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)