@@ -114,12 +114,14 @@ import qualified Prelude
114114if (_k_) < 0 || (_k_) >= (_len_) then error (" Data.HashMap.Internal.Array." ++ (_func_) ++ " : bounds error, offset " ++ show (_k_) ++ " , length " ++ show (_len_)) else
115115# define CHECK_OP(_func_,_op_,_lhs_,_rhs_) \
116116if not ((_lhs_) _op_ (_rhs_)) then error (" Data.HashMap.Internal.Array." ++ (_func_) ++ " : Check failed: _lhs_ _op_ _rhs_ (" ++ show (_lhs_) ++ " vs. " ++ show (_rhs_) ++ " )" ) else
117+ # define CHECK_GE(_func_,_lhs_,_rhs_) CHECK_OP(_func_,>=,_lhs_,_rhs_)
117118# define CHECK_GT(_func_,_lhs_,_rhs_) CHECK_OP(_func_,>,_lhs_,_rhs_)
118119# define CHECK_LE(_func_,_lhs_,_rhs_) CHECK_OP(_func_,<=,_lhs_,_rhs_)
119120# define CHECK_EQ(_func_,_lhs_,_rhs_) CHECK_OP(_func_,==,_lhs_,_rhs_)
120121#else
121122# define CHECK_BOUNDS(_func_,_len_,_k_)
122123# define CHECK_OP(_func_,_op_,_lhs_,_rhs_)
124+ # define CHECK_GE(_func_,_lhs_,_rhs_)
123125# define CHECK_GT(_func_,_lhs_,_rhs_)
124126# define CHECK_LE(_func_,_lhs_,_rhs_)
125127# define CHECK_EQ(_func_,_lhs_,_rhs_)
@@ -222,7 +224,7 @@ new_ n = new n undefinedElem
222224-- | The returned array is the same as the array given, as it is shrunk in place.
223225shrink :: MArray s a -> Int -> ST s (MArray s a )
224226shrink mary _n@ (I # n# ) =
225- CHECK_GT (" shrink" , _n, (0 :: Int ))
227+ CHECK_GE (" shrink" , _n, (0 :: Int ))
226228 CHECK_LE (" shrink" , _n, (unsafeLengthM mary))
227229 ST $ \ s -> case Exts. shrinkSmallMutableArray# (unMArray mary) n# s of
228230 s' -> (# s', mary # )
0 commit comments