# HG changeset patch # User Chris Cannam # Date 1369503721 -3600 # Node ID 704c58ab4598bc20a335f80e397605963bf715a3 # Parent 678477bf617cd10cb56e78f2baccf7fbbc8aecc2 Fixes to duplicate diff -r 678477bf617c -r 704c58ab4598 yetilab/stream/filter.yeti --- a/yetilab/stream/filter.yeti Sat May 25 18:41:53 2013 +0100 +++ b/yetilab/stream/filter.yeti Sat May 25 18:42:01 2013 +0100 @@ -217,8 +217,7 @@ pos[i] := pos[i] + n; encroachment = lowtide () - formerLow; if encroachment > 0 then - cache := mat.columnSlice cache encroachment - (mat.width cache - encroachment); + cache := mat.columnSlice cache encroachment (mat.width cache); fi); map do instance: pos[instance] := 0; @@ -242,11 +241,11 @@ else if count > ready then more = s.read (count - ready); - cache := mat.concat (Horizontal ()) - [cache, more]; + cache := mat.concat (Horizontal ()) [cache, more]; + hightide := hightide + (mat.width more); fi; - chunk = mat.columnSlice cache - (pos[instance] - (lowtide ())) count; + offset = pos[instance] - (lowtide ()); + chunk = mat.columnSlice cache offset (offset + count); advance instance (mat.width chunk); chunk; fi), diff -r 678477bf617c -r 704c58ab4598 yetilab/stream/test/test_filter.yeti --- a/yetilab/stream/test/test_filter.yeti Sat May 25 18:41:53 2013 +0100 +++ b/yetilab/stream/test/test_filter.yeti Sat May 25 18:42:01 2013 +0100 @@ -518,7 +518,7 @@ compare s1.available (Known 0) and compare s2.position 2 and compare s2.finished? false and - compare s2.available (maybeKnown 1) and + compare s2.available (Known 1) and // when one is known, so is the other compare (map vec.list (mat.asRows (s1.read 3))) [] and