@@ -146,15 +146,15 @@ TEMPLATE
146146inline bool CLASS::push (const Link& current, bytes& next,
147147 const Link& index) NOEXCEPT
148148{
149- return set_cell (next, current, index) != fault_cell ;
149+ return set_cell (next, current, index) != terminal ;
150150}
151151
152152TEMPLATE
153153inline bool CLASS::push (bool & collision, const Link& current, bytes& next,
154154 const Key& key) NOEXCEPT
155155{
156156 const auto previous = set_cell (next, current, index (key));
157- if (previous == fault_cell )
157+ if (previous == terminal )
158158 return false ;
159159
160160 // Caller searches Link{ next } for duplicate in case of filter collision.
@@ -172,7 +172,7 @@ inline CLASS::cell CLASS::get_cell(const Link& index) const NOEXCEPT
172172 using namespace system ;
173173 const auto raw = file_.get_raw (link_to_position (index));
174174 if (is_null (raw))
175- return fault_cell ;
175+ return terminal ;
176176
177177 if constexpr (aligned)
178178 {
@@ -205,7 +205,7 @@ inline CLASS::cell CLASS::set_cell(bytes& next, const Link& current,
205205 using namespace system ;
206206 const auto raw = file_.get_raw (link_to_position (index));
207207 if (is_null (raw))
208- return fault_cell ;
208+ return terminal ;
209209
210210 if constexpr (aligned)
211211 {
@@ -249,7 +249,7 @@ inline CLASS::cell CLASS::set_cell(bytes& next, const Link& current,
249249TEMPLATE
250250constexpr CLASS::link CLASS::to_link (cell value) NOEXCEPT
251251{
252- if (value == fault_cell )
252+ if (value == terminal )
253253 return {};
254254
255255 using namespace system ;
@@ -258,26 +258,30 @@ constexpr CLASS::link CLASS::to_link(cell value) NOEXCEPT
258258}
259259
260260TEMPLATE
261- constexpr CLASS::cell CLASS::to_filter (cell value ) NOEXCEPT
261+ constexpr CLASS::cell CLASS::to_cell (cell previous, link current ) NOEXCEPT
262262{
263- // TODO: mask link bits and return cell (private use).
264- return value;
265- }
266-
267- TEMPLATE
268- constexpr CLASS::cell CLASS::to_cell (cell /* previous*/ , link current) NOEXCEPT
269- {
270- // TODO: merge link into previous cell and update fingers.
263+ // [--------------filter---------------][--------------link--------------]
264+ // [[sen][--------fingerprints--------]][--------------link--------------]
265+
266+ // [[111][1111111111111111111111111111]] terminal (empty/default)
267+ // [[000][1111111111111111111111111111]] 1 FPs
268+ // [[001][2222222222222211111111111111]] 2 FPs
269+ // [[010][3333333333222222222111111111]] 3 FPs
270+ // [[011][4444444333333322222221111111]] 4 FPs
271+ // [[100][5555554444443333332222211111]] 5 FPs
272+ // [[101][6666655555444443333322221111]] 6 FPs
273+ // [[110][7777666655554444333322221111]] 7 FPs
274+ // [[111][0000000000000000000000000000]] overflow
271275 return current;
272276}
273277
274278TEMPLATE
275- constexpr bool CLASS::is_collision (cell value, const Key& /* key*/ ) NOEXCEPT
279+ constexpr bool CLASS::is_collision (cell value, const Key& key) NOEXCEPT
276280{
277- if (value == fault_cell )
281+ if (value == terminal )
278282 return false ;
279283
280- // TODO: true if overflow sentinel or any matching finger .
284+ // TODO: true if overflow sentinel or any matching FP .
281285 return true ;
282286}
283287
0 commit comments