Skip to content

Commit a7bacb7

Browse files
committed
[Support] Use hexdigit instead of manually coding the same thing. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259762 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 730d934 commit a7bacb7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Support/raw_ostream.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ raw_ostream &raw_ostream::write_hex(unsigned long long N) {
171171
char *CurPtr = EndPtr;
172172

173173
while (N) {
174-
uintptr_t x = N % 16;
175-
*--CurPtr = (x < 10 ? '0' + x : 'a' + x - 10);
174+
unsigned char x = static_cast<unsigned char>(N) % 16;
175+
*--CurPtr = hexdigit(x, /*LowerCase*/true);
176176
N /= 16;
177177
}
178178

0 commit comments

Comments
 (0)