refactor: reduce GC pressure by pre-allocating slices

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan
2024-11-19 07:45:24 -05:00
parent 3982ba7258
commit d229ff39e5
10 changed files with 325 additions and 262 deletions
+1 -1
View File
@@ -294,7 +294,7 @@ func (s *TagScanner) processChangedDir(ctx context.Context, refresher *refresher
// If track from folder is newer than the one in DB, select for update/insert in DB
log.Trace(ctx, "Processing changed folder", "dir", dir, "tracksInDB", len(currentTracks), "tracksInFolder", len(files))
var filesToUpdate []string
filesToUpdate := make([]string, 0, len(files))
for filePath, entry := range files {
c, inDB := currentTracks[filePath]
if !inDB || fullScan {