[PULL REQUEST] Subsurface branch - QtBluetooth serial implementation
Dirk Hohndel
dirk at hohndel.org
Mon Jul 6 14:31:47 PDT 2015
On Mon, Jul 06, 2015 at 02:02:54PM -0700, Thiago Macieira wrote:
> On Monday 06 July 2015 23:19:58 Claudiu Olteanu wrote:
> > > + bool on = !(mode == QBluetoothLocalDevice::HostPoweredOff);
> >
> > That's slightly weird :-)
> >
> > I know that this is weird but there is no HostPoweredOn enum :-). It can be
> > either off, connectable, discoverable or discoverable limited inquiry.
> > Therefore I choose to use !(mode == QBluetoothLocalDevice::HostPoweredOff))
> > instead of (mode == QBluetoothLocalDevice::HostDiscoverable || mode ==
> > QBluetoothLocalDevice::HostConnectable || ..)
>
> I meant doing
>
> bool on = !(x == y);
>
> instead of
>
> bool on = x != y;
I'd much prefer
bool on = (x != y);
The parenthesis may be optional but they make this much easier to read.
/D
More information about the subsurface
mailing list