[llvm-commits] [llvm] r93723 - /llvm/trunk/lib/Support/StringExtras.cpp

Benjamin Kramer benny.kra at googlemail.com
Mon Jan 18 04:40:06 PST 2010


Author: d0k
Date: Mon Jan 18 06:40:05 2010
New Revision: 93723

URL: http://llvm.org/viewvc/llvm-project?rev=93723&view=rev
Log:
Fix refacto reported by Nicolas Geoffray.

Modified:
    llvm/trunk/lib/Support/StringExtras.cpp

Modified: llvm/trunk/lib/Support/StringExtras.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/StringExtras.cpp?rev=93723&r1=93722&r2=93723&view=diff

==============================================================================
--- llvm/trunk/lib/Support/StringExtras.cpp (original)
+++ llvm/trunk/lib/Support/StringExtras.cpp Mon Jan 18 06:40:05 2010
@@ -39,13 +39,11 @@
                                                StringRef Delimiters) {
   // Figure out where the token starts.
   StringRef::size_type Start = Source.find_first_not_of(Delimiters);
-  if (Start == StringRef::npos) Start = Source.size();
 
   // Find the next occurrence of the delimiter.
   StringRef::size_type End = Source.find_first_of(Delimiters, Start);
-  if (End == StringRef::npos) End = Source.size();
 
-  return std::make_pair(Source.substr(Start, End), Source.substr(End));
+  return std::make_pair(Source.slice(Start, End), Source.substr(End));
 }
 
 /// SplitString - Split up the specified string according to the specified





More information about the llvm-commits mailing list