[Support/YAMLParser] Use rtrim on plain scalars.

llvm-svn: 156787
This commit is contained in:
Michael J. Spencer 2012-05-14 22:43:34 +00:00
parent 5a53bd3002
commit d6a42acd4e

View File

@ -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