Skip to content

Commit

Permalink
Apply perf optimization: don't call callback unless there are changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPenner committed Aug 31, 2023
1 parent 524700d commit fee4277
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions parser-typechecker/src/U/Codebase/Branch/Diff.hs
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,10 @@ streamNameChanges namePrefix (TreeDiff (DefinitionDiffs {termDiffs, typeDiffs} :
let name = appendName ns
in (listifyNames name $ adds diff, listifyNames name $ removals diff)
let nameChanges = NameChanges {termNameAdds, termNameRemovals, typeNameAdds, typeNameRemovals}
acc <- f namePrefix nameChanges
-- acc <-
-- if nameChanges == mempty
-- then pure mempty
-- else f namePrefix nameChanges
acc <-
if nameChanges == mempty
then pure mempty
else f namePrefix nameChanges
childAcc <-
children
& ifoldMapM
Expand Down

0 comments on commit fee4277

Please sign in to comment.