mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
towire: remove useless double-invert in towire_bool.
GCC optimizes it out anyway: I sent an uninitialized var and it sent 8! The receiver checks the value is 0 or 1 anyway. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
aea77653d3
commit
a8c60ed289
@ -40,7 +40,7 @@ void towire_u64(u8 **pptr, u64 v)
|
||||
|
||||
void towire_bool(u8 **pptr, bool v)
|
||||
{
|
||||
u8 val = !!v;
|
||||
u8 val = v;
|
||||
towire(pptr, &val, sizeof(val));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user