Skip to content

Commit 618aace

Browse files
committed
Optimized Print::print(String&) (part 2)
1 parent 6ae5928 commit 618aace

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

cores/arduino/Print.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ size_t Print::print(const __FlashStringHelper *ifsh)
4646

4747
size_t Print::print(const String &s)
4848
{
49-
size_t n = 0;
50-
for (uint16_t i = 0; i < s.length(); i++) {
51-
n += write(s[i]);
52-
}
53-
return n;
49+
return write(reinterpret_cast<const uint8_t*>(s.c_str()), s.length());
5450
}
5551

5652
size_t Print::print(const char str[])

0 commit comments

Comments
 (0)