def apply.batch.loop

mylsm-lsm-store@0.6.0.1 · src/ByteWalIo.bend:120

import mylsm-lsm-store@0.6.0.1/src/ByteWalIo.bend as ByteWalIo
import Base
import mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend as ByteMemTable
import mylsm-lsm-store@0.6.0.1/src/ByteWal.bend as ByteWal

120def apply.batch.loop(
121  fuel: Nat,
122  table: ByteMemTable.Table,
123  mutations: List<&1, ByteWal.Mutation>
124) -> ByteMemTable.Table:
125  match fuel:
126    case 0n:
127      table
128    case 1n+rest:
129      match mutations:
130        case Nil{}:
131          table
132        case Con{ByteWal.Put{key, value}, tail}:
133          apply.batch.loop(rest, ByteMemTable.put(table, key, value), tail)
134        case Con{ByteWal.Delete{key}, tail}:
135          apply.batch.loop(rest, ByteMemTable.del(table, key), tail)

Uses (6)

Used by (1)