chiark / gitweb /
peerdb/tripe-newpeers.in: Fix memoization while resolving inheritance.
The memoization never worked properly. It's clear, because the code
tries to store old values in the `map' dictionary, that it /wants/ to
optimize repeated visits to the same parent section, but unfortunately
nothing actually picks these saved values up again. I can't tell any
more, but I think this is because the memoization map never stored the
path, so a second visit would return an unhelpful truncated path.
Also, the per-lookup memoization isn't really very effective: we
pointlessly walk the inheritance graph afresh for each `get' call.
Replace this with a per-section cache of inheritance-resolved lookups,
complete with path information.