Build the map inline in CountAllFeeds()

No need to build an empty map to then add more fields in it one by one.
This commit is contained in:
jvoisin 2024-02-25 16:20:06 +01:00 committed by Frédéric Guillot
parent 04916a57d2
commit 1955350318

View file

@ -64,9 +64,11 @@ func (s *Storage) CountAllFeeds() map[string]int64 {
} }
defer rows.Close() defer rows.Close()
results := make(map[string]int64) results := map[string]int64{
results["enabled"] = 0 "enabled": 0,
results["disabled"] = 0 "disabled": 0,
"total": 0,
}
for rows.Next() { for rows.Next() {
var disabled bool var disabled bool