Mercurial > repos > rhope
view range.rhope @ 121:1af91ceaaf49
Fixed memory leak when an output is only attached to a single null input
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 28 Oct 2010 21:04:12 -0400 |
parents | a34a982ecd32 |
children |
line wrap: on
line source
Blueprint Range { Start End } Range[start,end:out] { out <- [[Build[Range()]]Start <<[start]]End <<[end] } First@Range[range:out,none] { If[[[range]Start >>] < [[range]End >>]] { out <- [range]Start >> }{ none <- range } } Next@Range[range,val:out,done] { next <- [val]+[1] If[[next] < [[range]End >>]] { out <- Val[next] }{ done <- range } } Index@Range[range,index:out,notfound] { If[[index] < [[range]End >>]] { If[[index] < [[range]Start >>]] { notfound <- index }{ out <- index } }{ notfound <- index } } Set@Range[range,index,val:out] { out <- [[()]Concatenate[range] ]Set[index,val] }