From 87fcd93cb504aa223c61987ab7964811f59873d8 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Fri, 16 Sep 2022 13:44:43 -0400 Subject: Stop using explicit ids from outside. --- tests/testdrive_sqlite.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/testdrive_sqlite.cpp') 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 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(); } -- cgit v1.2.3