aboutsummaryrefslogtreecommitdiff
path: root/core/sync
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-06-14 11:15:25 +0100
committergingerBill <bill@gingerbill.org>2021-06-14 11:15:25 +0100
commit86649e6b44877df3c5d0b81ed2f97aaa063a6f1d (patch)
tree700029b1021d4702e4877dd0c0355d3443df3865 /core/sync
parent3ca887a60ae1e681fd441edfe17805df97b6d6a3 (diff)
Core library clean up: Make range expressions more consistent and replace uses of `..` with `..=`
Diffstat (limited to 'core/sync')
-rw-r--r--core/sync/sync_darwin.odin2
-rw-r--r--core/sync/sync_freebsd.odin2
-rw-r--r--core/sync/sync_linux.odin2
3 files changed, 3 insertions, 3 deletions
diff --git a/core/sync/sync_darwin.odin b/core/sync/sync_darwin.odin
index c8e9632be..0fd2fc2a7 100644
--- a/core/sync/sync_darwin.odin
+++ b/core/sync/sync_darwin.odin
@@ -42,7 +42,7 @@ semaphore_destroy :: proc(s: ^Semaphore) {
semaphore_post :: proc(s: ^Semaphore, count := 1) {
// NOTE: SPEED: If there's one syscall to do this, we should use it instead of the loop.
- for in 0..count-1 {
+ for in 0..<count {
res := darwin.semaphore_signal(s.handle);
assert(res == 0);
}
diff --git a/core/sync/sync_freebsd.odin b/core/sync/sync_freebsd.odin
index 87532621d..0fa5f9e6f 100644
--- a/core/sync/sync_freebsd.odin
+++ b/core/sync/sync_freebsd.odin
@@ -33,7 +33,7 @@ semaphore_destroy :: proc(s: ^Semaphore) {
semaphore_post :: proc(s: ^Semaphore, count := 1) {
// NOTE: SPEED: If there's one syscall to do this, we should use it instead of the loop.
- for in 0..count-1 {
+ for in 0..<count {
assert(unix.sem_post(&s.handle) == 0);
}
}
diff --git a/core/sync/sync_linux.odin b/core/sync/sync_linux.odin
index aa3c7a068..6474cd900 100644
--- a/core/sync/sync_linux.odin
+++ b/core/sync/sync_linux.odin
@@ -33,7 +33,7 @@ semaphore_destroy :: proc(s: ^Semaphore) {
semaphore_post :: proc(s: ^Semaphore, count := 1) {
// NOTE: SPEED: If there's one syscall to do this, we should use it instead of the loop.
- for in 0..count-1 {
+ for in 0..<count {
assert(unix.sem_post(&s.handle) == 0);
}
}