Time.Zone.find: def of bend-kit-time@0.3.0.0 Import: import bend-kit-time@0.3.0.0/time.bend as Time Lines 1148-1155 of bend-kit-time@0.3.0.0/time.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-time@0.3.0.0/time.bend&start_line=1148&end_line=1155 import Base import bend-kit-int@0.2.0.0/int.bend as Int # The type index at secs: the last transition at or before it, or type 0 before the first. # ponytail: linear scan; bisect an Array if lookups get hot. def Zone.find(ts: List<&2, Trans>, +secs: Int.I64, +cur: U32) -> U32: match ts: case Nil{}: cur case Con{Trans{t, k}, rest}: Zone.find(rest, secs, Bool.pick(U32, Int.I64.is_le(t, secs), k, cur)) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bend-kit-int@0.2.0.0/int.bend&name=I64 https://jend.leeeet.dev/definition.txt?path=bend-kit-int@0.2.0.0/int.bend&name=I64.is_le https://jend.leeeet.dev/definition.txt?path=bend-kit-time@0.3.0.0/time.bend&name=Trans