You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the wire library there are several functions where an - unnecessarily - complex coding has been used:
endTransmission: the availability of data is already checked in while(...), therefore need not be checked again in the loop.
requestFrom: the for-loop has a predefined and fixed number of loops. Therefore a check whether the last element has been reached is unnecessary and does not add any benefit.
Attached are two patches to simplify these functions:
Hi @hfvogt
I've edited and cleaned up your previous comments.
This is the right place for submitting patches, if you have others I'll surely take a look at them (but probably this won't happen before Monday).
Our preferred way to receive contributions is through Github's pull requests, because it simplifies the review by reducing the amount of cut&paste. Moreover a Pull Request can be automatically merged using the Github website, so if you have other patches I'd ask you to submit them as Pull Request.
In the wire library there are several functions where
an unnecessarily complex coding has been used:
- endTransmission: the availability of data is already
checked in while(...), therefore need not be checked
again in the loop.
- requestFrom: the for-loop has a predefined and fixed
number of loops. Therefore a check whether the last
element has been reached is unnecessary and does not
add any benefit.
Fixesarduino#20
In the wire library there are several functions where
an unnecessarily complex coding has been used:
- endTransmission: the availability of data is already
checked in while(...), therefore need not be checked
again in the loop.
- requestFrom: the for-loop has a predefined and fixed
number of loops. Therefore a check whether the last
element has been reached is unnecessary and does not
add any benefit.
Fixes#20
In the wire library there are several functions where an - unnecessarily - complex coding has been used:
endTransmission: the availability of data is already checked in while(...), therefore need not be checked again in the loop.
requestFrom: the for-loop has a predefined and fixed number of loops. Therefore a check whether the last element has been reached is unnecessary and does not add any benefit.
Attached are two patches to simplify these functions:
If this is the wrong place to provide patched please guide me to the right place. I have more patches that I would like to share.
The text was updated successfully, but these errors were encountered: