def blocks.pack.finish

mylsm-lsm-store@0.6.0.1 · src/SstFile.bend:284

import mylsm-lsm-store@0.6.0.1/src/SstFile.bend as SstFile
import Base
import mylsm-lsm-store@0.6.0.1/src/MemTable.bend as MemTable

284# Finish the current block list, which is stored in reverse order.
285def blocks.pack.finish(
286  current: List<&2, MemTable.Entry>,
287  acc: List<&2, List<&2, MemTable.Entry>>
288) -> List<&2, List<&2, MemTable.Entry>>:
289  match current:
290    case Nil{}:
291      List.reverse(&2, List<&2, MemTable.Entry>, acc)
292    case Con{_, _}:
293      List.reverse(&2, List<&2, MemTable.Entry>,
294        Con{List.reverse(&2, MemTable.Entry, current), acc})

Uses (3)

Used by (1)