diff options
| author | gingerBill <bill@gingerbill.org> | 2024-07-14 15:09:38 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-07-14 15:09:38 +0100 |
| commit | 2d56e3805b31ec82ea72ed84a5f7bd555b93d253 (patch) | |
| tree | 1d7b93313cf08522d141f6058f922406d5ab0c06 | |
| parent | 4f73b35da5e9f84b0851f2ba66907a4f8de057ff (diff) | |
| parent | 76b0562acdec5a7084b7b89e7b87a0426a5f76c9 (diff) | |
Merge branch 'master' of https://github.com/odin-lang/Odin
| -rw-r--r-- | core/container/queue/queue.odin | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/container/queue/queue.odin b/core/container/queue/queue.odin index e7a60dde0..f83a5f2b7 100644 --- a/core/container/queue/queue.odin +++ b/core/container/queue/queue.odin @@ -95,11 +95,11 @@ front_ptr :: proc(q: ^$Q/Queue($T)) -> ^T { } back :: proc(q: ^$Q/Queue($T)) -> T { - idx := (q.offset+uint(q.len))%builtin.len(q.data) + idx := (q.offset+uint(q.len - 1))%builtin.len(q.data) return q.data[idx] } back_ptr :: proc(q: ^$Q/Queue($T)) -> ^T { - idx := (q.offset+uint(q.len))%builtin.len(q.data) + idx := (q.offset+uint(q.len - 1))%builtin.len(q.data) return &q.data[idx] } |