Optimal Setup for Toggle Sprint (and other features)

Sorry for the ■■■■ title. What I mean: A check in the options settings whether you should keep the button pressed to sprint or press it once to sprint until pressed again.

I know, the easiest way is a boolean. Set “bToggle” to true if toggling should be on. But in this setup, each and every time the sprint button is pressed, a branch check gets executed which doesn’t seem to be a lean approach.

Are there any other, more efficient ways to change between these kind of features?

I can think of setting up closed gates and open the once that is selected in the options menu. Each time the option is changed, all gates get closed again and the correct one gets opened. But isn’t a gate just another way of performing a simple boolean check? Would that be any leaner?

Looking forward to hearing your thoughts!