Skip to content

Commit 9c46bb3

Browse files
committed
stats: return early if no stats to write
Signed-off-by: Will Norris <[email protected]>
1 parent 3c4fb78 commit 9c46bb3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

golink.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@ func flushStats() error {
242242
stats.mu.Lock()
243243
defer stats.mu.Unlock()
244244

245+
if len(stats.dirty) == 0 {
246+
return nil
247+
}
248+
245249
if err := db.SaveStats(stats.dirty); err != nil {
246250
return err
247251
}

0 commit comments

Comments
 (0)