mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-14 07:31:47 +00:00
No need for "else if" after a return. Autosense "0o123" as octal in
StringRef::getAsInteger git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155298 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
55738761b3
commit
2dbd7844e8
@ -272,14 +272,22 @@ static unsigned GetAutoSenseRadix(StringRef &Str) {
|
||||
if (Str.startswith("0x")) {
|
||||
Str = Str.substr(2);
|
||||
return 16;
|
||||
} else if (Str.startswith("0b")) {
|
||||
}
|
||||
|
||||
if (Str.startswith("0b")) {
|
||||
Str = Str.substr(2);
|
||||
return 2;
|
||||
} else if (Str.startswith("0")) {
|
||||
return 8;
|
||||
} else {
|
||||
return 10;
|
||||
}
|
||||
|
||||
if (Str.startswith("0o")) {
|
||||
Str = Str.substr(2);
|
||||
return 8;
|
||||
}
|
||||
|
||||
if (Str.startswith("0"))
|
||||
return 8;
|
||||
|
||||
return 10;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user