Loop invariant code motion for cursor-index

part of darcs patch Sun Sep 18 17:39:17 EEST 2005  Martin Gasbichler <gasbichl@informatik.uni-tuebingen.de>
This commit is contained in:
eknauel 2005-09-27 09:02:28 +00:00
parent 48b7f617e0
commit 4d6cb75cd6
1 changed files with 3 additions and 2 deletions

View File

@ -143,7 +143,8 @@
(paint-selection-list-at select-list 0 0 win result-buffer have-focus?)) (paint-selection-list-at select-list 0 0 win result-buffer have-focus?))
(define (paint-selection-list-at select-list x y win result-buffer have-focus?) (define (paint-selection-list-at select-list x y win result-buffer have-focus?)
(let ((num-lines (select-list-num-lines select-list))) (let ((num-lines (select-list-num-lines select-list))
(cursor-index (select-list-cursor-index select-list)))
(let lp ((elts (let lp ((elts
(select-visible-elements select-list num-lines)) (select-visible-elements select-list num-lines))
(y y) (y y)
@ -151,7 +152,7 @@
(cond (cond
((null? elts) ((null? elts)
(values)) (values))
((= i (select-list-cursor-index select-list)) ((= i cursor-index)
(wattron win (A-REVERSE)) (wattron win (A-REVERSE))
(mvwaddstr win y x (element-text (car elts))) (mvwaddstr win y x (element-text (car elts)))
(wattrset win (A-NORMAL)) (wattrset win (A-NORMAL))