susumu.yata
null+****@clear*****
Thu Apr 25 11:13:26 JST 2013
susumu.yata 2013-04-25 11:13:26 +0900 (Thu, 25 Apr 2013) New Revision: 45c5b2a60f3075c99b8cbe0137e633d637649619 https://github.com/groonga/grnxx/commit/45c5b2a60f3075c99b8cbe0137e633d637649619 Message: Add grnxx::alpha::Map::min_key_id(). Modified files: lib/grnxx/alpha/map.hpp test/test_alpha_map.cpp Modified: lib/grnxx/alpha/map.hpp (+4 -0) =================================================================== --- lib/grnxx/alpha/map.hpp 2013-04-24 17:33:19 +0900 (8bc481d) +++ lib/grnxx/alpha/map.hpp 2013-04-25 11:13:26 +0900 (8a48177) @@ -126,6 +126,10 @@ class Map { // Return the type of "*this". virtual MapType type() const; + // Return the minimum key ID. + constexpr int64_t min_key_id() { + return 0; + } // Return the maximum key ID ever used. // If the map is empty, the return value can be -1. virtual int64_t max_key_id() const; Modified: test/test_alpha_map.cpp (+3 -0) =================================================================== --- test/test_alpha_map.cpp 2013-04-24 17:33:19 +0900 (b3e47c6) +++ test/test_alpha_map.cpp 2013-04-25 11:13:26 +0900 (4de2b82) @@ -332,6 +332,9 @@ void test_map(grnxx::alpha::MapType map_type) { assert(map->num_keys() == hash_map.size()); } + assert(map->min_key_id() == 0); + assert(map->max_key_id() == static_cast<std::int64_t>(MAP_SIZE - 1)); + { std::int64_t key_id = -1; for (std::size_t i = 0; i < MAP_SIZE; ++i) { -------------- next part -------------- HTML����������������������������...Download