[Groonga-commit] groonga/grnxx at 03912c8 [master] Remove grnxx::Map::next_key_id().

Back to archive index

susumu.yata null+****@clear*****
Fri May 31 15:13:47 JST 2013


susumu.yata	2013-05-31 15:13:47 +0900 (Fri, 31 May 2013)

  New Revision: 03912c85d23958a306ef95d77343b353f308c3bb
  https://github.com/groonga/grnxx/commit/03912c85d23958a306ef95d77343b353f308c3bb

  Message:
    Remove grnxx::Map::next_key_id().

  Modified files:
    lib/grnxx/map.hpp
    lib/grnxx/map/array_map.cpp
    lib/grnxx/map/array_map.hpp
    test/test_map.cpp

  Modified: lib/grnxx/map.hpp (+0 -2)
===================================================================
--- lib/grnxx/map.hpp    2013-05-31 11:38:43 +0900 (3eb8a2d)
+++ lib/grnxx/map.hpp    2013-05-31 15:13:47 +0900 (0bdf87c)
@@ -83,8 +83,6 @@ class Map {
   // Return the maximum key ID ever used.
   // The return value can be a negative value iff the map is empty.
   virtual int64_t max_key_id() const = 0;
-  // Return the ID of the expected next added ID.
-  virtual int64_t next_key_id() const = 0;
   // Return the number of keys.
   virtual uint64_t num_keys() const = 0;
 

  Modified: lib/grnxx/map/array_map.cpp (+0 -5)
===================================================================
--- lib/grnxx/map/array_map.cpp    2013-05-31 11:38:43 +0900 (7985727)
+++ lib/grnxx/map/array_map.cpp    2013-05-31 15:13:47 +0900 (b927f0a)
@@ -100,11 +100,6 @@ int64_t ArrayMap<T>::max_key_id() const {
 }
 
 template <typename T>
-int64_t ArrayMap<T>::next_key_id() const {
-  return header_->next_key_id;
-}
-
-template <typename T>
 uint64_t ArrayMap<T>::num_keys() const {
   return header_->num_keys;
 }

  Modified: lib/grnxx/map/array_map.hpp (+0 -1)
===================================================================
--- lib/grnxx/map/array_map.hpp    2013-05-31 11:38:43 +0900 (b2e41a6)
+++ lib/grnxx/map/array_map.hpp    2013-05-31 15:13:47 +0900 (6fd2e03)
@@ -55,7 +55,6 @@ class ArrayMap : public Map<T> {
   MapType type() const;
 
   int64_t max_key_id() const;
-  int64_t next_key_id() const;
   uint64_t num_keys() const;
 
   bool get(int64_t key_id, Key *key = nullptr);

  Modified: test/test_map.cpp (+0 -16)
===================================================================
--- test/test_map.cpp    2013-05-31 11:38:43 +0900 (7b28159)
+++ test/test_map.cpp    2013-05-31 15:13:47 +0900 (a381169)
@@ -456,20 +456,6 @@ void test_map_max_key_id(grnxx::MapType map_type) {
 }
 
 template <typename T>
-void test_map_next_key_id(grnxx::MapType map_type) {
-  std::unique_ptr<grnxx::Storage> storage(grnxx::Storage::create(nullptr));
-  std::unique_ptr<grnxx::Map<T>> map(
-      grnxx::Map<T>::create(map_type, storage.get(),
-                            grnxx::STORAGE_ROOT_NODE_ID));
-  assert(map);
-  assert(map->next_key_id() == grnxx::MAP_MIN_KEY_ID);
-  assert(map->add(generate_random_key<T>()));
-  assert(map->next_key_id() == (grnxx::MAP_MIN_KEY_ID + 1));
-  assert(map->unset(grnxx::MAP_MIN_KEY_ID));
-  assert(map->max_key_id() == grnxx::MAP_MIN_KEY_ID);
-}
-
-template <typename T>
 void test_map_num_keys(grnxx::MapType map_type) {
   std::unique_ptr<grnxx::Storage> storage(grnxx::Storage::create(nullptr));
   std::unique_ptr<grnxx::Map<T>> map(
@@ -714,7 +700,6 @@ void test_map_truncate(grnxx::MapType map_type) {
   }
   assert(map->truncate());
   assert(map->max_key_id() == (grnxx::MAP_MIN_KEY_ID - 1));
-  assert(map->next_key_id() == grnxx::MAP_MIN_KEY_ID);
   assert(map->num_keys() == 0);
   for (std::uint64_t i = 0; i < (MAP_NUM_KEYS / 2); ++i) {
     assert(map->add(keys[i]));
@@ -952,7 +937,6 @@ void test_map(grnxx::MapType map_type) {
   test_map_type<T>(map_type);
   test_map_min_key_id<T>(map_type);
   test_map_max_key_id<T>(map_type);
-  test_map_next_key_id<T>(map_type);
   test_map_num_keys<T>(map_type);
   test_map_get<T>(map_type);
   test_map_get_next<T>(map_type);
-------------- next part --------------
HTML����������������������������...
Télécharger 



More information about the Groonga-commit mailing list
Back to archive index