[PATCH] Improved logic in cylinder management and gas change events

Linus Torvalds torvalds at linux-foundation.org
Fri Mar 21 10:44:55 PDT 2014


On Fri, Mar 21, 2014 at 8:51 AM, Jan Mulder <jlmulder at planet.nl> wrote:
>
> First, I ran in to an obvious bug. Manually add a 2nd cylinder to a dive,
> and try to delete it right away.

Patch looks sane to me.

An alternative (and one I would prefer, actually) is to get rid of
that damn "used" flag entirely, and just replace it with iterating
over the events and seeing if it's used dynamically at runtime.

No point in carrying generated state along when you can just calculate
it. It's not like the decision "can I remove this cylinder" should be
performance-critical.

               Linus


More information about the subsurface mailing list