Skip to content

Commit 6095bcd

Browse files
committed
fix: correct newDirectKey implementation to avoid key collisions
1 parent 1bcc1bd commit 6095bcd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • hls-graph/src/Development/IDE/Graph/Internal

hls-graph/src/Development/IDE/Graph/Internal/Key.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ keyMap = unsafePerformIO $ newIORef (GlobalKeyValueMap Map.empty IM.empty 0)
9393
-- This is useful for keys that are not based on user data, e.g., for
9494
-- tracking temporary actions.
9595
newDirectKey :: Int -> Key
96-
newDirectKey i = UnsafeMkKey (- abs i)
96+
newDirectKey i = UnsafeMkKey $ negate (abs i + 1)
9797

9898
newKey :: (Typeable a, Hashable a, Show a) => a -> Key
9999
newKey k = unsafePerformIO $ do

0 commit comments

Comments
 (0)