aboutsummaryrefslogtreecommitdiff
path: root/lib/Support
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2012-05-14 22:43:34 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2012-05-14 22:43:34 +0000
commit24b709529f30bf8cb4769eefbfedb4179349fd28 (patch)
treec00834a55ba762dbc0b0ccaad53c29abaaf3995a /lib/Support
parent752026b69eb265750ca31f345579a4855c02d493 (diff)
[Support/YAMLParser] Use rtrim on plain scalars.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156787 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/YAMLParser.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/Support/YAMLParser.cpp b/lib/Support/YAMLParser.cpp
index 211ed2cdc3..29d938b387 100644
--- a/lib/Support/YAMLParser.cpp
+++ b/lib/Support/YAMLParser.cpp
@@ -1630,9 +1630,7 @@ StringRef ScalarNode::getValue(SmallVectorImpl<char> &Storage) const {
return UnquotedValue;
}
// Plain or block.
- size_t trimtrail = Value.rfind(' ');
- return Value.drop_back(
- trimtrail == StringRef::npos ? 0 : Value.size() - trimtrail);
+ return Value.rtrim(" ");
}
StringRef ScalarNode::unescapeDoubleQuoted( StringRef UnquotedValue