From 22537f932da095d16729c26e252eb2549f2b4350 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Tue, 21 Feb 2012 09:12:48 +0000 Subject: [PATCH] Replace a hand rolled loop with a lovely StringRef helper we have these days. No functionality changed. llvm-svn: 151048 --- lib/Support/Triple.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/Support/Triple.cpp b/lib/Support/Triple.cpp index 11cbb5f6c1b..72f31314517 100644 --- a/lib/Support/Triple.cpp +++ b/lib/Support/Triple.cpp @@ -335,10 +335,7 @@ Triple::Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr, std::string Triple::normalize(StringRef Str) { // Parse into components. SmallVector Components; - for (size_t First = 0, Last = 0; Last != StringRef::npos; First = Last + 1) { - Last = Str.find('-', First); - Components.push_back(Str.slice(First, Last)); - } + Str.split(Components, "-"); // If the first component corresponds to a known architecture, preferentially // use it for the architecture. If the second component corresponds to a