From b81d8bc8249ee35e87ea630413a311460e85eec0 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Mon, 5 Oct 2026 17:38:03 +0100 Subject: Text keys (023): a list knows the text field it is keyed by; an event's list keyed by a text is HASHED from its first item, its table's slots holding the texts' hashes (FNV-1a), a match the key cell's bytes too; HAS and a field by key read the table; its order made by a merge sort (the first eight bytes as a number, then all). A FIND whose index only an ITEM_SET of its list takes, the code between in a line finding by key alone, sets the item where it was found (PLAN_ROW: a HASHED list's slot, no position made). words 453 to 217 ms (5.8x C) text_keys_equivalence: adds, has, fields by key, sets where found, positions, runs, removes and clears against a tree keyed by the text --- core/module-list.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'core/module-list.h') diff --git a/core/module-list.h b/core/module-list.h index 3ae468f..369e8ed 100644 --- a/core/module-list.h +++ b/core/module-list.h @@ -159,6 +159,12 @@ bool pure_list_suits(PureList *, unsigned needs, unsigned narrow); bool pure_list_full(PureList *); /* Whether key is there, by the set: false when the list keeps none (search it then). */ bool pure_list_contains(const PureList *, double key, bool *found); +/* Whether a HASHED list keyed by a text has key (false: it is not one; search it). */ +bool pure_list_contains_text(const PureList *list, PureCell key, bool *found); +/* Where key is, for a set of the item found (pure_list_set_row): a HASHED + * list's slot (no position made), else its position (pure_list_seek). */ +size_t pure_list_find_row(const PureList *list, unsigned field, PureCell key, bool *found); +PureResult pure_list_set_row(PureList *list, size_t row, unsigned field, PureCell value, PureUndo *undo); /* The bytes it keeps beside its items for that. */ size_t pure_list_extra(const PureList *); /* An event's list (empty, never shared, journaled or undone) may keep its -- cgit v1.2.3