Simplify code.

llvm-svn: 98437
This commit is contained in:
Benjamin Kramer 2010-03-13 11:34:41 +00:00
parent ba2c65277a
commit 5ac3b0be2d
1 changed files with 5 additions and 11 deletions

View File

@ -502,19 +502,13 @@ void HTMLDiagnostics::HandlePiece(Rewriter& R, FileID BugFileID,
} }
static void EmitAlphaCounter(llvm::raw_ostream& os, unsigned n) { static void EmitAlphaCounter(llvm::raw_ostream& os, unsigned n) {
llvm::SmallString<10> buf; unsigned x = n % ('z' - 'a');
n /= 'z' - 'a';
do { if (n > 0)
unsigned x = n % ('z' - 'a'); EmitAlphaCounter(os, n);
buf.push_back('a' + x);
n = n / ('z' - 'a');
} while (n);
assert(!buf.empty()); os << char('a' + x);
for (llvm::SmallVectorImpl<char>::reverse_iterator I=buf.rbegin(),
E=buf.rend(); I!=E; ++I)
os << *I;
} }
unsigned HTMLDiagnostics::ProcessMacroPiece(llvm::raw_ostream& os, unsigned HTMLDiagnostics::ProcessMacroPiece(llvm::raw_ostream& os,