From d13c41a7aa7e259486cfdf7ccabcbb691abb0a60 Mon Sep 17 00:00:00 2001 From: Soumik Sarkar Date: Mon, 9 Dec 2024 19:48:59 +0530 Subject: [PATCH] Fix silly absw (#36) --- src/Regex/Internal/Num.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Regex/Internal/Num.hs b/src/Regex/Internal/Num.hs index 8d3a9c7..fdb9285 100644 --- a/src/Regex/Internal/Num.hs +++ b/src/Regex/Internal/Num.hs @@ -133,9 +133,7 @@ mkSignedIntRange minus plus wordRangeDec (low,high) = case (negR, nonNegR) of {-# INLINE mkSignedIntRange #-} absw :: Int -> Word -absw x = if x == minBound - then fromIntegral (abs (x+1) + 1) - else fromIntegral (abs x) +absw = fromIntegral . abs ------------------- -- Parsing ranges