mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 09:05:55 +00:00
don't forget to calculate in in differenceArrayRun
This commit is contained in:
parent
fd73eaa5cb
commit
f115249316
2 changed files with 3 additions and 1 deletions
|
|
@ -2481,6 +2481,7 @@ func differenceRunArray(a, b *container) *container {
|
|||
continue
|
||||
}
|
||||
output.runs = append(output.runs, interval16{start: start, last: vb - 1})
|
||||
output.n += int(vb - start)
|
||||
start = vb + 1
|
||||
bidx++
|
||||
if bidx >= len(b.array) {
|
||||
|
|
@ -2491,6 +2492,7 @@ func differenceRunArray(a, b *container) *container {
|
|||
|
||||
if start <= run.last {
|
||||
output.runs = append(output.runs, interval16{start: start, last: run.last})
|
||||
output.n += int(run.last - start + 1)
|
||||
}
|
||||
}
|
||||
output.Optimize()
|
||||
|
|
|
|||
|
|
@ -763,7 +763,7 @@ func TestDifferenceMixed(t *testing.T) {
|
|||
res := difference(a, b)
|
||||
|
||||
if !reflect.DeepEqual(res.array, []uint16{5, 7, 9}) {
|
||||
t.Fatalf("test #1 expected %v, but got %v", []uint16{5, 7, 9}, res.array)
|
||||
t.Fatalf("test #1 expected %v, but got %#v", []uint16{5, 7, 9}, res)
|
||||
}
|
||||
|
||||
res = difference(b, a)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue