Jpeg.jpeg.stream.take: def of gralha-jpeg-decode@0.1.0.1 Import: import gralha-jpeg-decode@0.1.0.1/jpeg.bend as Jpeg Lines 44-48 of gralha-jpeg-decode@0.1.0.1/jpeg.bend: https://jend.leeeet.dev/read.txt?path=gralha-jpeg-decode@0.1.0.1/jpeg.bend&start_line=44&end_line=48 import Base import gralha-text-scan@0.1.0.1/scan.bend as U def jpeg.stream.take(+stream: JPEGStream) -> JPEGRead: JPEGStream{data, position, word, count, scan, valid} = stream U.branch(JPEGRead, valid && U32.is_gt(count, 0), _ => JPEGRead{U32.and(U32.shrn(word, U32.to_nat((count - 1 : U32))), 1), JPEGStream{data, position, word, (count - 1 : U32), scan, valid}}, _ => JPEGRead{0, jpeg.stream.invalid(stream)}) Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_gt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shrn https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=gralha-jpeg-decode@0.1.0.1/jpeg.bend&name=JPEGRead https://jend.leeeet.dev/definition.txt?path=gralha-jpeg-decode@0.1.0.1/jpeg.bend&name=JPEGStream https://jend.leeeet.dev/definition.txt?path=gralha-jpeg-decode@0.1.0.1/jpeg.bend&name=jpeg.stream.invalid https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=branch