mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Make code easier to read (and avoid warning)
The old expression wass correct because if dive_table.dives[j]->number is != 0, then !dive_table.dives[j]->number is 0 and vice versa. But come on... The new code seems much more natural and easier to read. And of course the Apple compilers by default gave a warning because they suspected a precedence bug with the old code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
41bc8003d5
commit
788d65a527
1 changed files with 1 additions and 1 deletions
|
@ -866,7 +866,7 @@ struct dive *merge_two_dives(struct dive *a, struct dive *b)
|
||||||
// renumber dives from merged one in advance by difference between
|
// renumber dives from merged one in advance by difference between
|
||||||
// merged dives numbers. Do not renumber if actual number is zero.
|
// merged dives numbers. Do not renumber if actual number is zero.
|
||||||
for (; j < dive_table.nr; j++)
|
for (; j < dive_table.nr; j++)
|
||||||
if (!dive_table.dives[j]->number == 0)
|
if (dive_table.dives[j]->number != 0)
|
||||||
dive_table.dives[j]->number -= factor;
|
dive_table.dives[j]->number -= factor;
|
||||||
|
|
||||||
mark_divelist_changed(true);
|
mark_divelist_changed(true);
|
||||||
|
|
Loading…
Add table
Reference in a new issue