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
1 changed files with 5 additions and 3 deletions

View File

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