simplify as daniel suggests


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82415 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Support/StringRef.cpp b/lib/Support/StringRef.cpp
index af64642..a4c0e87 100644
--- a/lib/Support/StringRef.cpp
+++ b/lib/Support/StringRef.cpp
@@ -89,23 +89,16 @@
                                  unsigned long long &Result) {
   // Autosense radix if not specified.
   if (Radix == 0) {
-    if (Str[0] != '0') {
+    if (Str.startswith("0x")) {
+      Str = Str.substr(2);
+      Radix = 16;
+    } else if (Str.startswith("0b")) {
+      Str = Str.substr(2);
+      Radix = 2;
+    } else if (Str.startswith("0"))
+      Radix = 8;
+    else
       Radix = 10;
-    } else {
-      if (Str.size() < 2) {
-        Radix = 8;
-      } else {
-        if (Str[1] == 'x') {
-          Str = Str.substr(2);
-          Radix = 16;
-        } else if (Str[1] == 'b') {
-          Str = Str.substr(2);
-          Radix = 2;
-        } else {
-          Radix = 8;
-        }
-      }
-    }
   }
   
   // Empty strings (after the radix autosense) are invalid.