[PULL REQUEST] A couple of small mods post the delmulti rework
Dirk Hohndel
dirk at hohndel.org
Sat Sep 29 12:57:53 PDT 2012
Ummm, did i forget to push? That is verbatim what I did...
/D
--
Sent from my phone. Please excuse brevity and text prediction errors.
On September 29, 2012 12:48:41 PM Linus Torvalds
<torvalds at linux-foundation.org> wrote:
> On Sat, Sep 29, 2012 at 12:08 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
> >
> > I actually added the tripflag logic there, thinking that we didn't
> need to maintain the dive->divetrip but now that I think about this
> some more I believe I was wrong.
> >
> > Are you working on a fix or should I add that to my todo list?
>
> You claim to have fixed it, but what was it that fixed it?
>
> Shouldn't we update the "dive->divetrip" when we merge dives? IOW,
> something like this (whitespace-damaged) patch?
>
> Linus
>
> ---
> diff --git a/dive.c b/dive.c
> index b1739ad80e68..092153d8d3ba 100644
> --- a/dive.c
> +++ b/dive.c
> @@ -711,10 +711,13 @@ struct dive *try_to_merge(struct dive *a, struct dive *b)
>
> res->when = a->when;
> /* the larger tripflag is more relevant */
> - if(a->tripflag > b->tripflag)
> + if(a->tripflag > b->tripflag) {
> res->tripflag = a->tripflag;
> - else
> + res->divetrip = a->divetrip;
> + } else {
> res->tripflag = b->tripflag;
> + res->divetrip = b->divetrip;
> + }
> MERGE_NONZERO(res, a, b, latitude);
> MERGE_NONZERO(res, a, b, longitude);
> MERGE_TXT(res, a, b, location);
More information about the subsurface
mailing list