[project @ 2003-01-13 11:32:00 by simonmar]
authorsimonmar <unknown>
Mon, 13 Jan 2003 11:32:00 +0000 (11:32 +0000)
committersimonmar <unknown>
Mon, 13 Jan 2003 11:32:00 +0000 (11:32 +0000)
Fix off-by-one in splitWithPS.

Noticed-by: Tomasz Zielonka <t.zielonka@students.mimuw.edu.pl>

MERGE TO STABLE

Data/PackedString.hs

index da0206a..f82b756 100644 (file)
@@ -248,7 +248,7 @@ splitWithPS pred (PS ps) =
          : splitify (break_pt + 1)
 
 first_pos_that_satisfies pred ps len n = 
-   case [ m | m <- [n..len], pred (ps ! m) ] of
+   case [ m | m <- [n..len-1], pred (ps ! m) ] of
        []    -> len
        (m:_) -> m