diff options
author | Arne Juul <arnej@verizonmedia.com> | 2020-09-04 13:07:30 +0000 |
---|---|---|
committer | Arne Juul <arnej@verizonmedia.com> | 2020-09-04 13:07:38 +0000 |
commit | 5648f551b6f8953a79fe4d31ce5ffeebe17609a8 (patch) | |
tree | 4fc0133bfba7a5515acaa207d8316fe6520e2e46 /eval | |
parent | 6785469ac47303825b4195bbd03e2f574f0c1582 (diff) |
copy the entire hash table and adjust the pointers.
Diffstat (limited to 'eval')
-rw-r--r-- | eval/src/vespa/eval/tensor/sparse/sparse_tensor.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/eval/src/vespa/eval/tensor/sparse/sparse_tensor.cpp b/eval/src/vespa/eval/tensor/sparse/sparse_tensor.cpp index 63b7fa2e45c..b097486c51b 100644 --- a/eval/src/vespa/eval/tensor/sparse/sparse_tensor.cpp +++ b/eval/src/vespa/eval/tensor/sparse/sparse_tensor.cpp @@ -29,11 +29,11 @@ using Cells = SparseTensor::Cells; void copyCells(Cells &cells, const Cells &cells_in, Stash &stash) { - cells.resize(cells_in.capacity()); - for (const auto &cell : cells_in) { + cells = cells_in; + for (auto &cell : cells) { SparseTensorAddressRef oldRef = cell.first; SparseTensorAddressRef newRef(oldRef, stash); - cells[newRef] = cell.second; + cell.first = newRef; } } |