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.
This lib makes heavy use of pass by reference, even where it is not necessary or even counterproductive.
For example since
smlStateexpects aunsigned char &one can not do something likecurrentState = smlState(Serial.read()).I don't think passing by reference of primitive types like
charhas 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.