Skip to content

Commit 9d13023

Browse files
committed
Merge pull request #3211 from Chris--A/println-optimize
Println optimize
2 parents b4c5fa7 + 527c7c2 commit 9d13023

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

hardware/arduino/avr/cores/arduino/Print.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,7 @@ size_t Print::print(const Printable& x)
122122

123123
size_t Print::println(void)
124124
{
125-
size_t n = print('\r');
126-
n += print('\n');
127-
return n;
125+
return write("\r\n");
128126
}
129127

130128
size_t Print::println(const String &s)

hardware/arduino/sam/cores/arduino/Print.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,7 @@ size_t Print::print(const Printable& x)
115115

116116
size_t Print::println(void)
117117
{
118-
size_t n = print('\r');
119-
n += print('\n');
120-
return n;
118+
return write("\r\n");
121119
}
122120

123121
size_t Print::println(const String &s)

0 commit comments

Comments
 (0)