Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/include/storage/page/b_plus_tree_internal_page.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class BPlusTreeInternalPage : public BPlusTreePage {

void Init(int max_size = INTERNAL_PAGE_SLOT_CNT);

auto KeyAt(int index) const -> KeyType;
auto KeyAt(int index) const -> const KeyType &;

void SetKeyAt(int index, const KeyType &key);

Expand All @@ -62,7 +62,7 @@ class BPlusTreeInternalPage : public BPlusTreePage {
*/
auto ValueIndex(const ValueType &value) const -> int;

auto ValueAt(int index) const -> ValueType;
auto ValueAt(int index) const -> const ValueType &;

/**
* @brief For test only, return a string representing all keys in
Expand Down
2 changes: 1 addition & 1 deletion src/include/storage/page/b_plus_tree_leaf_page.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class BPlusTreeLeafPage : public BPlusTreePage {
// Helper methods
auto GetNextPageId() const -> page_id_t;
void SetNextPageId(page_id_t next_page_id);
auto KeyAt(int index) const -> KeyType;
auto KeyAt(int index) const -> const KeyType &;

/**
* @brief For test only return a string representing all keys in
Expand Down
4 changes: 2 additions & 2 deletions src/storage/page/b_plus_tree_internal_page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void B_PLUS_TREE_INTERNAL_PAGE_TYPE::Init(int max_size) { UNIMPLEMENTED("TODO(P2
* @return Key at index
*/
INDEX_TEMPLATE_ARGUMENTS
auto B_PLUS_TREE_INTERNAL_PAGE_TYPE::KeyAt(int index) const -> KeyType {
auto B_PLUS_TREE_INTERNAL_PAGE_TYPE::KeyAt(int index) const -> const KeyType & {
UNIMPLEMENTED("TODO(P2): Add implementation.");
}

Expand All @@ -64,7 +64,7 @@ void B_PLUS_TREE_INTERNAL_PAGE_TYPE::SetKeyAt(int index, const KeyType &key) {
* @return Value at index
*/
INDEX_TEMPLATE_ARGUMENTS
auto B_PLUS_TREE_INTERNAL_PAGE_TYPE::ValueAt(int index) const -> ValueType {
auto B_PLUS_TREE_INTERNAL_PAGE_TYPE::ValueAt(int index) const -> const ValueType & {
UNIMPLEMENTED("TODO(P2): Add implementation.");
}

Expand Down
4 changes: 3 additions & 1 deletion src/storage/page/b_plus_tree_leaf_page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ void B_PLUS_TREE_LEAF_PAGE_TYPE::SetNextPageId(page_id_t next_page_id) {
* array offset)
*/
INDEX_TEMPLATE_ARGUMENTS
auto B_PLUS_TREE_LEAF_PAGE_TYPE::KeyAt(int index) const -> KeyType { UNIMPLEMENTED("TODO(P2): Add implementation."); }
auto B_PLUS_TREE_LEAF_PAGE_TYPE::KeyAt(int index) const -> const KeyType & {
UNIMPLEMENTED("TODO(P2): Add implementation.");
}

template class BPlusTreeLeafPage<GenericKey<4>, RID, GenericComparator<4>>;
template class BPlusTreeLeafPage<GenericKey<8>, RID, GenericComparator<8>>;
Expand Down