From f567a6bd0398b75c2664e19a274b708351bf3c69 Mon Sep 17 00:00:00 2001 From: Harpreet Sangar Date: Tue, 27 Jun 2023 18:49:43 +0530 Subject: [PATCH] Update return type to `short`. --- src/numeric_range_trie.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/numeric_range_trie.cpp b/src/numeric_range_trie.cpp index a51f1594..268f32e2 100644 --- a/src/numeric_range_trie.cpp +++ b/src/numeric_range_trie.cpp @@ -474,7 +474,7 @@ void NumericTrie::Node::insert_geopoint(const uint64_t& cell_id, const uint32_t& return insert_geopoint_helper(cell_id, seq_id, level, max_level); } -inline int get_index(const int64_t& value, const char& level, const char& max_level) { +inline short get_index(const int64_t& value, const char& level, const char& max_level) { // Values are index considering higher order of the bytes first. // 0x01020408 (16909320) would be indexed in the trie as follows: // Level Index @@ -485,7 +485,7 @@ inline int get_index(const int64_t& value, const char& level, const char& max_le return (value >> (8 * (max_level - level))) & 0xFF; } -inline int get_geopoint_index(const uint64_t& cell_id, const char& level) { +inline short get_geopoint_index(const uint64_t& cell_id, const char& level) { // Doing 8-level since cell_id is a 64 bit number. return (cell_id >> (8 * (8 - level))) & 0xFF; } @@ -772,7 +772,7 @@ void NumericTrie::Node::search_range_helper(const int64_t& low,const int64_t& hi auto index = low_index + 1; // All the nodes in-between low and high are a match by default. - while (index < std::min(high_index, (int)EXPANSE)) { + while (index < std::min(high_index, EXPANSE)) { if (root->children[index] != nullptr) { matches.push_back(root->children[index]); }