optimisation
authorJoey Hess <joeyh@joeyh.name>
Fri, 29 Dec 2023 14:51:05 +0000 (10:51 -0400)
committerJoey Hess <joeyh@joeyh.name>
Fri, 29 Dec 2023 14:51:05 +0000 (10:51 -0400)
Command/Info.hs

index 3027572945741b96f760603d8ed8e49a6424d581..864ad0257913a314e8c53d25fe70ac9f71a5a9b1 100644 (file)
@@ -627,10 +627,11 @@ cachedAllRepoData = do
                Nothing -> do
                        matcher <- lift getKeyOnlyMatcher
                        !v <- lift $ overLocationLogs emptyKeyInfo $ \k locs d -> do
-                               numcopies <- genericLength . snd
-                                       <$> trustPartition DeadTrusted locs
                                ifM (matchOnKey matcher k)
-                                       ( return (addKeyCopies numcopies k d)
+                                       ( do
+                                               numcopies <- genericLength . snd
+                                                       <$> trustPartition DeadTrusted locs
+                                               return (addKeyCopies numcopies k d)
                                        , return d
                                        )
                        put s { allRepoData = Just v }