From 0f57225a6616c152ea46a2f36ea30343df3a6bf1 Mon Sep 17 00:00:00 2001 From: Patrick Roncagliolo Date: Sat, 7 Jan 2017 00:16:34 +0100 Subject: [PATCH 1/2] Change double quotes to single quotes - "." is a string literal, and so is treated as the char '.' plus the null char '\0'. - Single quotes reduces the necessary memory for this literal to only one char instead. A string literal as the one actually present may require the use of the method "write(const char *str)", so there could be also a performance overhead. - Another reason to change quotes style is for consistency with line 235. Signed-off-by: Patrick Roncagliolo --- hardware/arduino/avr/cores/arduino/Print.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardware/arduino/avr/cores/arduino/Print.cpp b/hardware/arduino/avr/cores/arduino/Print.cpp index 652fed094..1e4c99a65 100644 --- a/hardware/arduino/avr/cores/arduino/Print.cpp +++ b/hardware/arduino/avr/cores/arduino/Print.cpp @@ -250,7 +250,7 @@ size_t Print::printFloat(double number, uint8_t digits) // Print the decimal point, but only if there are digits beyond if (digits > 0) { - n += print("."); + n += print('.'); } // Extract digits from the remainder one at a time From e6a3b99697291892587117eded56cfc30ebd2531 Mon Sep 17 00:00:00 2001 From: Patrick Roncagliolo Date: Sat, 7 Jan 2017 10:20:56 +0100 Subject: [PATCH 2/2] Change quote style for single char in sam too Signed-off-by: Patrick Roncagliolo --- hardware/arduino/sam/cores/arduino/Print.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardware/arduino/sam/cores/arduino/Print.cpp b/hardware/arduino/sam/cores/arduino/Print.cpp index 089a02bc4..881722e89 100644 --- a/hardware/arduino/sam/cores/arduino/Print.cpp +++ b/hardware/arduino/sam/cores/arduino/Print.cpp @@ -242,7 +242,7 @@ size_t Print::printFloat(double number, uint8_t digits) // Print the decimal point, but only if there are digits beyond if (digits > 0) { - n += print("."); + n += print('.'); } // Extract digits from the remainder one at a time