Hi Andreas,

On Wed, Mar 28, 2018 at 3:56 PM, Andreas Tille <ti...@debian.org> wrote:

> there is an ITP for pyton-datrie (#828741) which needs an additional
> function in libdatrie.  Upstream has created a patch[1] which provides
> this missing function.  I took the freedom to create a new branch in
> libdatrie Git[2] which incorporates the said patch + fixes.  I also
> adapted the symbols file even if I'm aware that its bad style to inject
> a new symbol in a random Debian revision.

Thanks for the effort to make it available in Debian!

I have communicated with Filip Pytloun, the patch author,
in a personal mail for some time. And here's my comment
excerpt:

---8<---
  I wonder what's wrong with trie_state_get_data()?
  Why don't you just use it?

  And, from your patch, it looks like what the new function
  tries to do is to get the TAIL-associated data  *without*
  verifying the entire key. Only prefix mathing up to the single-path
  separation point is enough, and 's' does not have to be
  a real terminal state, which contradicts the function
  name and the documentation.

  I think trie_state_get_data() could be used instead.
---8<---

And I haven't got further explanation yet.

What I can guess from the patch is that it looks like an attempt
to speed up trie enumeration by bypassing the check of
the rest of the key. But unfortunately, in general users' viewpoint,
it could be confusing when a non-terminal state (which appears
to be in a separate path, but has not reached the end yet) gets
the data from a *_get_terminal_data() function, whose
documentation states that its argument is a *terminal* state.

Meanwhile, the existing trie_state_get_data() does exactly
the same to a *terminal* state, but not to a non-terminal one.
If something is still missing, we had better fix it there,
rather than introducing a new similar API.

That's why I haven't accepted the patch upstream so far.

Kind regards,
-- 
Theppitak Karoonboonyanan
http://linux.thai.net/~thep/

Reply via email to