Skip to content

Commit a81294f

Browse files
committed
avoid writing to base variable so the compiler has a chance of better optimization due to it being basically const then
1 parent e5c727e commit a81294f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/arduino/Print.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ size_t Print::printNumber(unsigned long n, uint8_t base)
208208
}
209209

210210
// prevent crash if called with base == 1
211-
if (base < 2) base = 10;
211+
if (base < 2) return printNumber(n, 10);
212212

213213
// use -D ARDUINO_PRINT_NUMBER_GENERIC_ONLY when compiling to get only the generic version
214214
#ifndef ARDUINO_PRINT_NUMBER_GENERIC_ONLY

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy