Fix page link_idx computation

This commit is contained in:
Joscha 2022-10-22 00:01:58 +02:00
parent a9435e4f64
commit 3296f6d15a

View file

@ -73,7 +73,7 @@ impl FirstStage {
} }
fn insert_page(&mut self, id: u32, length: u32, redirect: bool, title: String) { fn insert_page(&mut self, id: u32, length: u32, redirect: bool, title: String) {
let link_idx = self.pages.len() as u32; let link_idx = self.links.len() as u32;
self.pages.push(Page { self.pages.push(Page {
link_idx, link_idx,
id, id,
@ -156,7 +156,7 @@ impl SecondStage {
fn insert_page(&mut self, page: &Page<()>) { fn insert_page(&mut self, page: &Page<()>) {
let mut page = page.clone(); let mut page = page.clone();
page.link_idx = self.pages.len() as u32; page.link_idx = self.links.len() as u32;
self.pages.push(page); self.pages.push(page);
} }