1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-05-05 07:24:48 +03:00

Revert to explicit calculation of modulo, saving 16 bytes in IROM.

This commit is contained in:
Dirk O. Kaar 2020-01-28 22:42:47 +01:00
parent af53772e7b
commit 7e1d891e84

View File

@ -280,8 +280,9 @@ size_t Print::printNumber(unsigned long n, uint8_t base) {
base = 10;
do {
char c = n % base;
unsigned long m = n;
n /= base;
char c = m - base * n;
*--str = c < 10 ? c + '0' : c + 'A' - 10;
} while(n);
@ -300,8 +301,9 @@ size_t Print::printNumber(unsigned long long n, uint8_t base) {
base = 10;
do {
char c = n % base;
unsigned long m = n;
n /= base;
char c = m - base * n;
*--str = c < 10 ? c + '0' : c + 'A' - 10;
} while(n);