Re: [PATCH] Reuse cmdname->len to store pre-calculated similarity indexes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alex Riesen <raa.lkml@xxxxxxxxx> writes:

> To avoid doing that while sorting
>
> Signed-off-by: Alex Riesen <raa.lkml@xxxxxxxxx>
> ---
>
> Alex Riesen, Sat, Aug 30, 2008 18:44:15 +0200:
>> 2008/8/30 Junio C Hamano <gitster@xxxxxxxxx>:
>> > I wonder if it makes sense to give an otherwise unused "score" member to
>> 
>> Hmm, it is a _non-existing_ member of cmdname, isn't it?
>> 
>> > the "struct cmdname", compute the distance only once per each command, and
>> > use that as the sort key (alternatively you can have a separate int[N]
>> > array to store similarity values for each item in the cmdnames list, only
>> > used inside this codepath).
>> 
>> I think I'll take the struct cmdname->len over.

I think you do not need the file-scope static levenshtein_cmd anymore with
this change, if you make similarity() take two command names.  No?

Please reroll the whole f66dd34 (git wrapper: DWIM mistyped commands,
2008-08-28), as it is not part of any solid integration branch yet.

You might also want to update the commit log message to talk about the
"len" reuse hack, but you already have in-code comment which might be
sufficient.




--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux