Skip to content

Commit

Permalink
Fix a shadowing bug
Browse files Browse the repository at this point in the history
Summary: Occasionally variable shadowing is an actual bug :)

Reviewed By: phlalx, malanka

Differential Revision: D64955840

fbshipit-source-id: 841e79bd5e0a829a362d87b019a081d0805eaddd
  • Loading branch information
Simon Marlow authored and facebook-github-bot committed Oct 25, 2024
1 parent 9c308ad commit 9e88745
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions glean/db/Glean/Query/Reorder.hs
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,14 @@ reorderStmtGroup
-> [FlatStatement] -- these can float anywhere
-> [FlatStatement] -- final ordering
reorderStmtGroup _ _ ordered [] = ordered
reorderStmtGroup sc bound ordered floating =
reorderStmtGroup sc initBound ordered floating =
let
(lookups, others) = partitionStmts (map summarise floating)
ord = map summarise ordered
r = layout (IntSet.toList bound) bound lookups others ord
r = layout (IntSet.toList initBound) initBound lookups others ord
in
trace (show (vcat [
"reorderStmtGroup: " <> pretty (show bound),
"reorderStmtGroup: " <> pretty (show initBound),
indent 2 (displayDefault (FlatStatementGroup ordered floating)),
"===>",
indent 2 (vcat (map displayDefault r)) ])) r
Expand Down Expand Up @@ -324,7 +324,7 @@ reorderStmtGroup sc bound ordered floating =
-- but gives better results than not reordering recursively at
-- all.
cost = classify bound $ FlatDisjunction
[ FlatStatementGroup (reorderStmtGroup sc bound ord float) []
[ FlatStatementGroup (reorderStmtGroup sc initBound ord float) []
| FlatStatementGroup ord float <- groups ]
FlatNegation{} -> (Nothing, bound, Nothing, stmt)
FlatConditional{} -> (Nothing, bound, Nothing, stmt)
Expand Down

0 comments on commit 9e88745

Please sign in to comment.