Skip to content

Optimization in print.cpp [imported] #884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cmaglie opened this issue Nov 15, 2012 · 1 comment
Closed

Optimization in print.cpp [imported] #884

cmaglie opened this issue Nov 15, 2012 · 1 comment
Labels
feature request A request to make an enhancement (not a bug fix) Print and Stream class The Arduino core library's Print and Stream classes
Milestone

Comments

@cmaglie
Copy link
Member

cmaglie commented Nov 15, 2012

This is Issue 884 moved from a Google Code project.
Added by 2012-04-11T11:57:21.000Z by rob.till...@gmail.com.
Please review that bug for more context and additional comments, but update this bug.

Original labels: Type-Defect, Priority-Medium

Original description

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:

@facchinm
Copy link
Member

Fixed with #3211

@ffissore ffissore added this to the Release 1.6.5 milestone May 28, 2015
@per1234 per1234 added Print and Stream class The Arduino core library's Print and Stream classes feature request A request to make an enhancement (not a bug fix) labels Jul 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A request to make an enhancement (not a bug fix) Print and Stream class The Arduino core library's Print and Stream classes
Projects
None yet
Development

No branches or pull requests

5 participants