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

Jan Mulder jlmulder at planet.nl
Sat Mar 22 03:04:53 PDT 2014


On 21-03-14 18:44, Linus Torvalds wrote:

> 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.

I agree with this idea of removing the "used" flag. I'm in the process of
building a patch for it, so Dirk may decide what to do. I would propose just
to skip the current sane but sub-optimal patch.

> 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
>
best,

--jan




More information about the subsurface mailing list