forked from vieter-v/vieter
feat(docker): added ChunkedResponseReader implementation
This commit is contained in:
parent
da46b8b4ae
commit
92cbea69d6
6 changed files with 161 additions and 20 deletions
|
|
@ -92,3 +92,19 @@ pub fn pretty_bytes(bytes int) string {
|
|||
|
||||
return '${n:.2}${util.prefixes[i]}'
|
||||
}
|
||||
|
||||
pub fn match_array_in_array<T>(a1 []T, a2 []T) int {
|
||||
mut i := 0
|
||||
mut match_len := 0
|
||||
|
||||
for i + match_len < a1.len {
|
||||
if a1[i + match_len] == a2[match_len] {
|
||||
match_len += 1
|
||||
} else {
|
||||
i += match_len + 1
|
||||
match_len = 0
|
||||
}
|
||||
}
|
||||
|
||||
return match_len
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue