Skip to content

Commit 9014290

Browse files
committed
Fix non deterministic delete behavior. Reverted to the original slicing behavior despite it leaks. Filed issue #61 to debug this further.
1 parent 9845651 commit 9014290

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

bql/table/table.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,13 +294,10 @@ func (t *Table) DotProduct(t2 *Table) error {
294294

295295
// DeleteRow removes the row at position i from the table.
296296
func (t *Table) DeleteRow(i int) error {
297-
td := make([]Row, len(t.data)-1, len(t.data)-1) // Preallocate resulting table.
298297
if i < 0 || i >= len(t.data) {
299298
return fmt.Errorf("cannot delete row %d from a table with %d rows", i, len(t.data))
300299
}
301-
copy(td, t.data[:i])
302-
copy(td[i:], t.data[i+1:])
303-
t.data = td
300+
t.data = append(t.data[:i], t.data[i+1:]...)
304301
return nil
305302
}
306303

0 commit comments

Comments
 (0)