Browse Source

AutoIndexObj primary should start with 0

tags/v0.6.0-beta
Jesse Lee 5 years ago
parent
commit
81bf4bde1d
2 changed files with 4 additions and 4 deletions
  1. +1
    -1
      mindspore/ccsrc/dataset/util/auto_index.h
  2. +3
    -3
      tests/ut/cpp/dataset/btree_test.cc

+ 1
- 1
mindspore/ccsrc/dataset/util/auto_index.h View File

@@ -91,7 +91,7 @@ class AutoIndexObj : public BPlusTree<int64_t, T, A> {
}

private:
static constexpr key_type kMinKey = 1;
static constexpr key_type kMinKey = 0;
std::atomic<key_type> inx_;
};
} // namespace dataset


+ 3
- 3
tests/ut/cpp/dataset/btree_test.cc View File

@@ -190,9 +190,9 @@ TEST_F(MindDataTestBPlusTree, Test3) {
EXPECT_TRUE(rc.IsOk());
uint64_t min = ai.min_key();
uint64_t max = ai.max_key();
EXPECT_EQ(min, 1);
EXPECT_EQ(max, 4);
auto r = ai.Search(3);
EXPECT_EQ(min, 0);
EXPECT_EQ(max, 3);
auto r = ai.Search(2);
auto &it = r.first;
EXPECT_EQ(it.value(), "b");
MS_LOG(INFO) << "Dump all the values using [] operator.";


Loading…
Cancel
Save