[llvm] r303726 - [APInt] Use std::end to avoid mentioning the size of a local buffer repeatedly.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed May 24 00:00:56 PDT 2017


Author: ctopper
Date: Wed May 24 02:00:55 2017
New Revision: 303726

URL: http://llvm.org/viewvc/llvm-project?rev=303726&view=rev
Log:
[APInt] Use std::end to avoid mentioning the size of a local buffer repeatedly.

Modified:
    llvm/trunk/lib/Support/APInt.cpp

Modified: llvm/trunk/lib/Support/APInt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APInt.cpp?rev=303726&r1=303725&r2=303726&view=diff
==============================================================================
--- llvm/trunk/lib/Support/APInt.cpp (original)
+++ llvm/trunk/lib/Support/APInt.cpp Wed May 24 02:00:55 2017
@@ -2045,7 +2045,7 @@ void APInt::toString(SmallVectorImpl<cha
 
   if (isSingleWord()) {
     char Buffer[65];
-    char *BufPtr = Buffer+65;
+    char *BufPtr = std::end(Buffer);
 
     uint64_t N;
     if (!Signed) {
@@ -2069,7 +2069,7 @@ void APInt::toString(SmallVectorImpl<cha
       *--BufPtr = Digits[N % Radix];
       N /= Radix;
     }
-    Str.append(BufPtr, Buffer+65);
+    Str.append(BufPtr, std::end(Buffer));
     return;
   }
 




More information about the llvm-commits mailing list