diff options
author | Chris Xiong <chirs241097@gmail.com> | 2022-09-16 13:44:43 -0400 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2022-09-16 13:44:43 -0400 |
commit | 87fcd93cb504aa223c61987ab7964811f59873d8 (patch) | |
tree | 5ee76e81505e45044a799f853235d28365ee9f24 /tests | |
parent | 62bb6fcd83c2ee6bfd058c2e2f925b9946d185a1 (diff) | |
download | deduper-87fcd93cb504aa223c61987ab7964811f59873d8.tar.xz |
Stop using explicit ids from outside.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testdrive_sqlite.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/testdrive_sqlite.cpp b/tests/testdrive_sqlite.cpp index 168d974..02f9259 100644 --- a/tests/testdrive_sqlite.cpp +++ b/tests/testdrive_sqlite.cpp @@ -213,6 +213,8 @@ void job_func(int thid, size_t id) sdb->lock(); std::set<size_t> v; + size_t dbid = sdb->put_signature(files[id], ss.full); + sdb->batch_find_subslice_begin(); for (size_t i = 0; i < nsliceh * nslicev; ++i) { @@ -225,7 +227,7 @@ void job_func(int thid, size_t id) std::tie(std::ignore, othersig) = sdb->get_signature(match.id); double dist = ss.full.distance(othersig); if (dist < threshold) - sdb->put_dupe_pair(id, match.id, dist); + sdb->put_dupe_pair(dbid, match.id, dist); } } } @@ -233,11 +235,9 @@ void job_func(int thid, size_t id) sdb->batch_put_subslice_begin(); for (size_t i = 0; i < nsliceh * nslicev; ++i) - sdb->put_subslice(id, i, ss.subslices[i]); + sdb->put_subslice(dbid, i, ss.subslices[i]); sdb->batch_end(); - sdb->put_signature(id, files[id], ss.full); - sdb->unlock(); } |