charts.lines: rename search-index to search-first
parent
e9606b38d9
commit
418b798460
|
@ -15,7 +15,7 @@ TUPLE: line < gadget color data ;
|
||||||
: (line-vertices) ( seq -- vertices )
|
: (line-vertices) ( seq -- vertices )
|
||||||
concat [ 0.3 + ] float-array{ } map-as ;
|
concat [ 0.3 + ] float-array{ } map-as ;
|
||||||
|
|
||||||
: search-index ( elt seq -- index elt )
|
: search-first ( elt seq -- index elt )
|
||||||
[ first <=> ] with search ;
|
[ first <=> ] with search ;
|
||||||
|
|
||||||
: finder ( elt seq -- seq quot )
|
: finder ( elt seq -- seq quot )
|
||||||
|
@ -53,8 +53,8 @@ TUPLE: line < gadget color data ;
|
||||||
|
|
||||||
: clip-by-first ( min,max pairs -- pairs' )
|
: clip-by-first ( min,max pairs -- pairs' )
|
||||||
2dup first-in-bounds? [
|
2dup first-in-bounds? [
|
||||||
[ dup first ] dip [ search-index ] keep adjusted-tail
|
[ dup first ] dip [ search-first ] keep adjusted-tail
|
||||||
[ second ] dip [ search-index ] keep adjusted-head
|
[ second ] dip [ search-first ] keep adjusted-head
|
||||||
] [
|
] [
|
||||||
2drop { } clone
|
2drop { } clone
|
||||||
] if ;
|
] if ;
|
||||||
|
|
Loading…
Reference in New Issue