summaryrefslogtreecommitdiff
path: root/lib/Support/FileUtilities.cpp
diff options
context:
space:
mode:
authorLauro Ramos Venancio <lauro.venancio@gmail.com>2008-01-28 20:02:51 +0000
committerLauro Ramos Venancio <lauro.venancio@gmail.com>2008-01-28 20:02:51 +0000
commit42f6e455de71099d12d30dc928748147bfc8f801 (patch)
treeb453960f7087aabde653313751b97f62f1676655 /lib/Support/FileUtilities.cpp
parent07d403e222931ff20fdfecca1e1702b2cec2891c (diff)
downloadllvm-42f6e455de71099d12d30dc928748147bfc8f801.tar.gz
llvm-42f6e455de71099d12d30dc928748147bfc8f801.tar.bz2
llvm-42f6e455de71099d12d30dc928748147bfc8f801.tar.xz
Simplify the code and fix a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46458 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/FileUtilities.cpp')
-rw-r--r--lib/Support/FileUtilities.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/Support/FileUtilities.cpp b/lib/Support/FileUtilities.cpp
index 30463e8679..42083e46bd 100644
--- a/lib/Support/FileUtilities.cpp
+++ b/lib/Support/FileUtilities.cpp
@@ -21,13 +21,10 @@
using namespace llvm;
static bool isSignedChar(char C) {
- if (C == '+' || C == '-')
- return true;
- else
- return false;
+ return (C == '+' || C == '-');
}
-static bool isExpoentChar(char C) {
+static bool isExponentChar(char C) {
switch (C) {
case 'D': // Strange exponential notation.
case 'd': // Strange exponential notation.
@@ -42,7 +39,7 @@ static bool isNumberChar(char C) {
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
case '.': return true;
- default: return isSignedChar(C) || isExpoentChar(C);
+ default: return isSignedChar(C) || isExponentChar(C);
}
}
@@ -53,7 +50,7 @@ static char *BackupNumber(char *Pos, char *FirstChar) {
// Otherwise, return to the start of the number.
while (Pos > FirstChar && isNumberChar(Pos[-1])) {
--Pos;
- if (Pos > FirstChar && isSignedChar(Pos[0]) && !isExpoentChar(Pos[-1]))
+ if (Pos > FirstChar && isSignedChar(Pos[0]) && !isExponentChar(Pos[-1]))
break;
}
return Pos;