Skip to content

Commit 7225fd4

Browse files
resyntax-ci[bot]rfindler
authored andcommitted
Fix 1 occurrence of named-let-loop-to-for-in-range
This named `let` expression is equivalent to a `for` loop that uses `in-range`.
1 parent 8beee05 commit 7225fd4

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

drracket-core-lib/drracket/private/palaka.rkt

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,15 @@
2424
(define (draw-palaka dc w h)
2525
(define alpha (send dc get-alpha))
2626
(send dc set-pen palaka-color 1 'transparent)
27-
(let loop ([dx (- (/ quadrant-size 2))])
28-
(when (< dx w)
29-
(let loop ([dy (- (/ quadrant-size 2))])
30-
(when (< dy h)
31-
(send dc set-alpha 1)
32-
(send dc set-brush palaka-color 'solid)
33-
(send dc draw-rectangle dx dy quadrant-size quadrant-size)
34-
(send dc set-brush "white" 'solid)
35-
(draw-one-palaka dc dx dy)
36-
(loop (+ dy quadrant-size))))
37-
(loop (+ dx quadrant-size))))
27+
(for ([dx (in-range (- (/ quadrant-size 2)) w quadrant-size)])
28+
(let loop ([dy (- (/ quadrant-size 2))])
29+
(when (< dy h)
30+
(send dc set-alpha 1)
31+
(send dc set-brush palaka-color 'solid)
32+
(send dc draw-rectangle dx dy quadrant-size quadrant-size)
33+
(send dc set-brush "white" 'solid)
34+
(draw-one-palaka dc dx dy)
35+
(loop (+ dy quadrant-size)))))
3836
(send dc set-alpha alpha))
3937

4038
(define (draw-one-palaka dc dx dy)

0 commit comments

Comments
 (0)