From 40c186dfe5c7a641e2e08ac66d45ed706b9d2eea Mon Sep 17 00:00:00 2001 From: "Renan Santana (from Dev Box)" Date: Tue, 11 Jun 2024 18:22:15 -0700 Subject: [PATCH 1/3] remove unused line --- src/pq_flash_index.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pq_flash_index.cpp b/src/pq_flash_index.cpp index 265f266bd..5cff00efa 100644 --- a/src/pq_flash_index.cpp +++ b/src/pq_flash_index.cpp @@ -675,7 +675,6 @@ template bool PQFlashIndex::point_has_any_label(uint32_t point_id, const std::vector &label_ids) { uint32_t start_vec = _pts_to_label_offsets[point_id]; - uint32_t num_lbls = _pts_to_label_counts[start_vec]; bool ret_val = false; for (auto &cur_lbl : label_ids) { @@ -706,9 +705,10 @@ void PQFlashIndex::parse_label_file(std::basic_istream &infile, uint32_t num_pts_in_label_file; uint32_t num_total_labels; get_label_file_metadata(buffer, num_pts_in_label_file, num_total_labels); + _num_total_labels = num_total_labels; _pts_to_label_offsets = new uint32_t[num_pts_in_label_file]; - _pts_to_label_counts = new uint32_t[num_pts_in_label_file]; + _pts_to_label_counts = new uint32_t[num_total_labels]; _pts_to_labels = new LabelT[num_total_labels]; uint32_t labels_seen_so_far = 0; From cd56e61f555e8cb20c0109581b2f0365f2745663 Mon Sep 17 00:00:00 2001 From: "Renan Santana (from Dev Box)" Date: Wed, 12 Jun 2024 09:19:19 -0700 Subject: [PATCH 2/3] remove old code --- src/pq_flash_index.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pq_flash_index.cpp b/src/pq_flash_index.cpp index 5cff00efa..7427114c3 100644 --- a/src/pq_flash_index.cpp +++ b/src/pq_flash_index.cpp @@ -705,10 +705,9 @@ void PQFlashIndex::parse_label_file(std::basic_istream &infile, uint32_t num_pts_in_label_file; uint32_t num_total_labels; get_label_file_metadata(buffer, num_pts_in_label_file, num_total_labels); - _num_total_labels = num_total_labels; _pts_to_label_offsets = new uint32_t[num_pts_in_label_file]; - _pts_to_label_counts = new uint32_t[num_total_labels]; + _pts_to_label_counts = new uint32_t[num_pts_in_label_file]; _pts_to_labels = new LabelT[num_total_labels]; uint32_t labels_seen_so_far = 0; From 3a3e8af945a7bf12d9c7852ddbeee342a409d732 Mon Sep 17 00:00:00 2001 From: "Renan Santana (from Dev Box)" Date: Wed, 12 Jun 2024 09:20:42 -0700 Subject: [PATCH 3/3] remove other unused line --- src/pq_flash_index.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pq_flash_index.cpp b/src/pq_flash_index.cpp index 7427114c3..491614a42 100644 --- a/src/pq_flash_index.cpp +++ b/src/pq_flash_index.cpp @@ -674,7 +674,6 @@ inline bool PQFlashIndex::point_has_label(uint32_t point_id, LabelT l template bool PQFlashIndex::point_has_any_label(uint32_t point_id, const std::vector &label_ids) { - uint32_t start_vec = _pts_to_label_offsets[point_id]; bool ret_val = false; for (auto &cur_lbl : label_ids) {