dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit 1fd8a01d492cb5be6c4a4d8da659cf84bcce15dc
parent ca90364b693172ee9c386f1879567173d6cb825e
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Thu,  2 Mar 2023 20:58:11 -0800

fix warning

Diffstat:
Mpkg/web/handlers/handlers.go | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pkg/web/handlers/handlers.go b/pkg/web/handlers/handlers.go @@ -1270,16 +1270,16 @@ LIMIT 100`, data.Search).Scan(&data.Links).Error; err != nil { linksIDs = append(linksIDs, l.ID) } // Keep pointers to links for fast access - cache := make(map[int64]*database.Link) + linksCache := make(map[int64]*database.Link) for i, l := range data.Links { - cache[l.ID] = &data.Links[i] + linksCache[l.ID] = &data.Links[i] } // Get all mirrors for all links that we have var mirrors []database.LinksMirror database.DB.Raw(`select * from links_mirrors where link_id in (?)`, linksIDs).Scan(&mirrors) // Put mirrors in links for _, m := range mirrors { - if l, ok := cache[m.LinkID]; ok { + if l, ok := linksCache[m.LinkID]; ok { l.Mirrors = append(l.Mirrors, m) } }