diff options
| author | VladPavliuk <pavliuk.vlad@gmail.com> | 2024-07-14 18:22:20 +0300 |
|---|---|---|
| committer | VladPavliuk <pavliuk.vlad@gmail.com> | 2024-07-14 18:22:20 +0300 |
| commit | 3f8712edb03390c1eed4dced27f7c2707cf14ecb (patch) | |
| tree | a186834d911e19418836bf2ca3f52f334c11267a /core/container/queue/queue.odin | |
| parent | 79e2f63182581547dcdb7593397d1c3e280a5670 (diff) | |
| parent | e7d37607ef9ce54a80d83230150874b71d628d6d (diff) | |
Merge branch 'master' into json-add-int-key-map-support
Diffstat (limited to 'core/container/queue/queue.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] } |