ilikecats567 / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

Optimization in print.cpp #884

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

print.cpp contains 

size_t Print::println(void)
{
  size_t n = print('\r');
  n += print('\n');
  return n;
}

which can be optimized to

size_t Print::println(void)
{
   return write ("\r\n");
}

It is simpler and it has less call overhead.

For a background discussion, see: 
- http://arduino.cc/forum/index.php/topic,100712.0.html - 

Original issue reported on code.google.com by rob.till...@gmail.com on 11 Apr 2012 at 11:57