Author: laurov Date: Mon Jan 28 14:02:51 2008 New Revision: 46458 URL: http://llvm.org/viewvc/llvm-project?rev=46458&view=rev Log: Simplify the code and fix a typo.
Modified: llvm/trunk/lib/Support/FileUtilities.cpp Modified: llvm/trunk/lib/Support/FileUtilities.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/FileUtilities.cpp?rev=46458&r1=46457&r2=46458&view=diff ============================================================================== --- llvm/trunk/lib/Support/FileUtilities.cpp (original) +++ llvm/trunk/lib/Support/FileUtilities.cpp Mon Jan 28 14:02:51 2008 @@ -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 @@ 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 @@ // 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; _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits