From 9b141d75e80d138ed22ac59df3810e6397b9a196 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Mon, 20 Apr 2026 08:58:00 -0400 Subject: [PATCH] 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. --- internal/router/reader.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/router/reader.go b/internal/router/reader.go index f413a9a..d71aa07 100644 --- a/internal/router/reader.go +++ b/internal/router/reader.go @@ -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{