Skip to content

Pass by reference #16

@WhiskyDelta

Description

@WhiskyDelta

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions