Closed jasaw closed 2 years ago
Since you have if (!lua_isnoneornil(L, 6)) {
in both the if
and the else
branch I don't see why this couldn't be the primary condition to check (i.e. guarding the if-else with it).
That's a fair point @marcelstoer. It would probably be a bit nicer. I resolved the merge conflict that appeared when I merged the other patches, but I'll hold off merging this one until @jasaw has had a chance to comment.
@marcelstoer @jmattsson I've moved if (!lua_isnoneornil(L, 6)) {
to the outside of the if-else block as suggested.
Cheers!
The current code is a little confusing to read and doesn't return error when given an invalid input. There are 2 code paths here:
echo
parameter. Ifecho
is not provided, we leave the existinginput_echo
flag unchanged.pins config table
parameter.This PR cleans up the code a bit to make it clearer.
This PR makes changes on top of PR #3540
@jmattsson Please review.