[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    Re: [PATCH] [PoC] A simpler find_unique_prefixes() implementation
From:       Johannes Schindelin <Johannes.Schindelin () gmx ! de>
Date:       2019-08-30 20:12:41
Message-ID: nycvar.QRO.7.76.6.1908302209220.46 () tvgsbejvaqbjf ! bet
[Download RAW message or body]


Hi G=C3=A1bor,

On Wed, 28 Aug 2019, SZEDER G=C3=A1bor wrote:

> Implement find_unique_prefixes() by sorting the prefix items
> lexicographically and then looking for unique prefixes in adjacent
> pairs.  It's definitely shorter than the current hashmap-based
> implementation (101 vs 149 lines), subjectively easier to follow, and
> hopefully less buggy (some of the new elements in the test trigger
> failure with the hashmap).
>
> TODO: deal multi-byte caracter sequences, make the test tool more
>       developer-friendly

Sorry for my late response, I am still trying to catch up with an
ever-growing inbox after trying to pretend to be on vacation.

Your argument is a strong one, and I will try to re-roll, folding the
functionality to find the unique prefixes into `add-interactive.c` while
trying to reuse the already-sorted list for the lookup by prefix.

As to the multi-byte UTF-8 characters: you're right, that code has a
bug. The intention was to require only single-byte characters in the
prefix, for simplicity.

Thanks,
Dscho


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic