refactor(router): replace temporary variable pointer pattern with new() builtin

Simplify page number and chapter number pointer creation in reader route
registration by using inline new() instead of local variable + address-of.
This commit is contained in:
2026-04-20 08:58:00 -04:00
parent 8ac6e1ac79
commit 9b141d75e8
+2 -4
View File
@@ -123,14 +123,12 @@ func registerReaderRoutes(cfg *Config) {
var pageNumber *int
if b.PageNumber.Valid {
pn := int(b.PageNumber.Int32)
pageNumber = &pn
pageNumber = new(int(b.PageNumber.Int32))
}
var chapterNumber *int
if b.ChapterNumber.Valid {
cn := int(b.ChapterNumber.Int32)
chapterNumber = &cn
chapterNumber = new(int(b.ChapterNumber.Int32))
}
templateBookmarks[i] = templates.Bookmark{