]> gitweb.factorcode.org Git - factor.git/commitdiff
charts.lines: reduce the amount of data copying in draw-lines
authorAlexander Iljin <ajsoft@yandex.ru>
Tue, 17 Jan 2017 19:16:29 +0000 (22:16 +0300)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 17 Apr 2017 20:54:50 +0000 (13:54 -0700)
lines/lines.factor

index 4c8f795eb5be9e122105fe8e8dc86d6fca91159d..6c17c17b5a805159dc5a2efb2bb13de8f99ca4aa 100644 (file)
@@ -172,8 +172,8 @@ ALIAS: y second
 PRIVATE>
 
 : draw-line ( seq -- )
-    dup dup length odd? [ [ 1 head* ] dip ] [ 1 head* ] if
-    1 tail append
+    dup [ 1 head-slice* ] over length odd? [ dip ] [ call ] if
+    1 tail-slice append
     [ (line-vertices) gl-vertex-pointer GL_LINES 0 ] keep
     length glDrawArrays ;