// 上面的是L page,接下来新建一个R page:
// Copy L.P1…L.Kn−1 to a block of memory T that can hold n (pointer, key-value) pairs
std::list<MappingType> virtual_node;
// 归并新插入的键值和leafpage里的键值
bool inserted_newkey = false;
for(int i = 0; i < leafptr->GetSize(); i++){
// 找到第一个key大的键值
if(!inserted_newkey && comparator_(key, array[i].first) == -1){
// key先进链表
inserted_newkey = true;
virtual_node.push_back(std::make_pair(key, value));
}
virtual_node.push_back(array[i]);
}
if(!inserted_newkey){
virtual_node.push_back(std::make_pair(key, value));
}
// virtual node 构建完了
// 这个提交的时候要注释掉 影响性能
assert(virtual_node.size() == leafptr->GetSize()+1);```
04-20
1285
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-07
213
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)