chiark / gitweb /
minor tidy
authorDan Sheppard <dan.sheppard.circle@gmail.com>
Mon, 12 May 2025 11:13:42 +0000 (12:13 +0100)
committerDan Sheppard <dan.sheppard.circle@gmail.com>
Mon, 12 May 2025 11:13:42 +0000 (12:13 +0100)
src/page.c

index 05e08dcd37ec6e22004ec92374c2ce9918da1f26..1a7978736d645ac527450805fdaf3c6044b887e4 100644 (file)
@@ -1,14 +1,16 @@
 #include <stdlib.h>
 #include "page.h"
 
+static off_t nursery_size_bytes(struct cq_filemeta *fm) {
+    return (2<<(fm->super.current.nursery_size + fm->super.current.block_size));
+}
+
 off_t cq_offset_main_page(coquet_t *cq, int which_file, u_int64_t pgid) {
     struct cq_filemeta *fm;
     off_t header;
-    off_t nursery;
 
     fm = &(cq->filemeta[which_file]);
-    nursery = (2<<(fm->super.current.nursery_size + fm->super.current.block_size));
-    header = 2*SUPER_BYTES + nursery;
+    header = 2*SUPER_BYTES + nursery_size_bytes(fm);
 
     return header + (pgid-1) * (1<<fm->super.current.block_size);
 }