diff --git a/build/shared/revisions.txt b/build/shared/revisions.txt index 24b5a162d..66bb02f64 100644 --- a/build/shared/revisions.txt +++ b/build/shared/revisions.txt @@ -11,6 +11,7 @@ ARDUINO 1.5.6 BETA [core] * sam: Fixed wrap-around bug in delay() (Mark Tillotson) * sam: Fixed regression in analogRead() (fails to read multiple channels) (Mark Tillotson) +* Optimized Print::print(String&) method, now uses internal string buffer to perform block write ARDUINO 1.5.5 BETA 2013.11.28 diff --git a/hardware/arduino/sam/cores/arduino/Print.cpp b/hardware/arduino/sam/cores/arduino/Print.cpp index 78c5e3600..5e4810d55 100644 --- a/hardware/arduino/sam/cores/arduino/Print.cpp +++ b/hardware/arduino/sam/cores/arduino/Print.cpp @@ -46,11 +46,7 @@ size_t Print::print(const __FlashStringHelper *ifsh) size_t Print::print(const String &s) { - size_t n = 0; - for (uint16_t i = 0; i < s.length(); i++) { - n += write(s[i]); - } - return n; + return write(reinterpret_cast(s.c_str()), s.length()); } size_t Print::print(const char str[])