docs: Updated README.md

This commit is contained in:
2026-06-21 22:49:05 -04:00
parent 80f163dcde
commit d200c3bccf
3 changed files with 90 additions and 42 deletions

View File

@@ -1,5 +1,6 @@
package findr
import "core:bytes"
import "core:fmt"
import "core:os"
import "core:strings"
@@ -180,14 +181,21 @@ collect_worker :: proc(t: ^thread.Thread) {
batch, ok := chan.recv(data.ch)
if !ok do break
start := 0
for i in 0 ..< len(batch) {
if batch[i] == '\n' {
if i > start {
s, _ := strings.clone(string(batch[start:i]))
append(data.results, s)
}
start = i + 1
for {
remaining: []u8
#no_bounds_check {remaining = batch[start:]}
idx := bytes.index_byte(remaining, '\n')
if idx < 0 do break
i := start + idx
if i > start {
segment: []u8
#no_bounds_check {segment = batch[start:i]}
s, _ := strings.clone(string(segment))
append(data.results, s)
}
start = i + 1
}
delete(batch)
}