From c10948d02b7252f009bf553897a2ee8acff627ab Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Mon, 14 May 2012 22:43:34 +0000 Subject: [PATCH] [Support/YAMLParser] Use rtrim on plain scalars. llvm-svn: 156787 --- llvm/lib/Support/YAMLParser.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/llvm/lib/Support/YAMLParser.cpp b/llvm/lib/Support/YAMLParser.cpp index 211ed2cdc3de..29d938b3874b 100644 --- a/llvm/lib/Support/YAMLParser.cpp +++ b/llvm/lib/Support/YAMLParser.cpp @@ -1630,9 +1630,7 @@ StringRef ScalarNode::getValue(SmallVectorImpl &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