From 9e88745301953c0345edd665fdbb382145d98a69 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Fri, 25 Oct 2024 15:41:03 -0700 Subject: [PATCH] Fix a shadowing bug Summary: Occasionally variable shadowing is an actual bug :) Reviewed By: phlalx, malanka Differential Revision: D64955840 fbshipit-source-id: 841e79bd5e0a829a362d87b019a081d0805eaddd --- glean/db/Glean/Query/Reorder.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/glean/db/Glean/Query/Reorder.hs b/glean/db/Glean/Query/Reorder.hs index d4fd16176..ea169a0a3 100644 --- a/glean/db/Glean/Query/Reorder.hs +++ b/glean/db/Glean/Query/Reorder.hs @@ -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 @@ -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)