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
This lib makes heavy use of pass by reference, even where it is not necessary or even counterproductive.
For example since smlState expects a unsigned char & one can not do something like currentState = smlState(Serial.read()).
I don't think passing by reference of primitive types like char has any performance advantages, on the contrary it is probably even slower than just passing by value since the address is bigger than the value.
If you really want to pass by reference here you should make it const unsigned char & to avoid having to read the bytes into a variable befor passing to smlState.
The text was updated successfully, but these errors were encountered:
This lib makes heavy use of pass by reference, even where it is not necessary or even counterproductive.
For example since
smlState
expects aunsigned char &
one can not do something likecurrentState = smlState(Serial.read())
.I don't think passing by reference of primitive types like
char
has any performance advantages, on the contrary it is probably even slower than just passing by value since the address is bigger than the value.If you really want to pass by reference here you should make it
const unsigned char &
to avoid having to read the bytes into a variable befor passing to smlState.The text was updated successfully, but these errors were encountered: