From a9abda5655af0adf289208edf58bcd06d77f2f05 Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Tue, 9 Jan 2024 10:12:30 -0500 Subject: [PATCH] Do defer first for style reasons --- snapshot/store.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snapshot/store.go b/snapshot/store.go index 13e76793..bd5ea9d5 100644 --- a/snapshot/store.go +++ b/snapshot/store.go @@ -207,12 +207,12 @@ func (s *Store) Stats() (map[string]interface{}, error) { // Reap reaps all snapshots, except the most recent one. Returns the number of // snapshots reaped. func (s *Store) Reap() (retN int, retErr error) { - if s.reapDisabled { - return 0, nil - } defer func() { stats.Add(snapshotsReaped, int64(retN)) }() + if s.reapDisabled { + return 0, nil + } snapshots, err := s.getSnapshots() if err != nil {