Skip to main content
Bluvy Tube
Press Esc to exit fullscreen
Volume m
/
i
Theater mode t
f
/
🚨 Off-by-one bugs in Swift loops? Check the end of the range first. 1...5 → 5 laps ✅ 1..<5 → 4 laps ✅ 0..<60 → 60 laps ✅ (a watch face: 60 ticks, minute 0 to 59) 🧵

Keyboard shortcuts

Space K
Play / pause
← →
Back / forward 5 s
J L
Back / forward 10 s
0–9
Jump to 0%–90% of the video
Home End
Start / end
, .
Previous / next frame (while paused)
< >
Slower / faster
↑ ↓
Volume
M
Mute / unmute
C
Captions
F
Fullscreen
I
Picture-in-picture
T
Theater mode
?
Show this help

🚨 Off-by-one bugs in Swift loops? Check the end of the range first. 1...5 → 5 laps ✅ 1..<5 → 4 laps ✅ 0..<60 → 60 laps ✅ (a watch face: 60 ticks, minute 0 to 59) 🧵

Cane Allesta

Cane Allesta

@caneallesta.bsky.social

Subscribe
0 views Published on 02/12/2026 06:11 1:20
🚨 Off-by-one bugs in Swift loops? Check the end of the range first. 1...5 → 5 laps ✅ 1..<5 → 4 laps ✅ 0..<60 → 60 laps ✅ (a watch face: 60 ticks, minute 0 to 59) 🧵
1 comment
?
🛠️ stride(from:to:by:) stops before the end, like ..<
🛠️ stride(from:through:by:) includes it, like ...
⬇️ A negative step counts down
🔁 .reversed() flips a range

🎯 Build the sequence that holds exactly the values you need. Your loop body gets simpler.
View original post on Bluesky
Link copied to clipboard

Sign in

Time to take a break

You've been watching videos for 30 minutes straight: give yourself 5 minutes away from the screen. Stand up, stretch, grab a glass of water… Your videos will be right here when you're back.