Browse Source

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>
ppa-0.6.1
Rusty Russell 7 years ago
parent
commit
a8c60ed289
  1. 2
      wire/towire.c

2
wire/towire.c

@ -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…
Cancel
Save