Fix find_trip_by_idx() over-zealous cleanup

Commit bcf1f8c4fe ("Don't do "remove_from_trip" by walking the gtk
data structures") made find_trip_by_idx() only work for negative indexes
(positive indexes are dives), but when it removed the unnecessary test
for negativity, the statement inside it should have been kept as
unconditional, rather than removed with the test.

Oops.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Linus Torvalds 2013-02-19 11:04:30 -08:00 committed by Dirk Hohndel
parent bcf1f8c4fe
commit a00bfc918a

View file

@ -1035,7 +1035,7 @@ static dive_trip_t *find_trip_by_idx(int idx)
if (idx >= 0)
return NULL;
idx = -idx;
while (trip) {
if (trip->index == idx)
return trip;