diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2022-08-18 18:00:25 +0200 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2022-08-18 18:00:25 +0200 |
| commit | e40b3ad338f45d2241deef57664b3b10c8d64da2 (patch) | |
| tree | 83fb5e15290e2e6cffdd3c93b9fc0fc404405db6 /core | |
| parent | afec321db2ba30581d04e369d1864140ccfd20a6 (diff) | |
Remove unused `n` from PQ; add `reflect.is_bit_set`
Diffstat (limited to 'core')
| -rw-r--r-- | core/container/priority_queue/priority_queue.odin | 1 | ||||
| -rw-r--r-- | core/reflect/types.odin | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/core/container/priority_queue/priority_queue.odin b/core/container/priority_queue/priority_queue.odin index e324287f3..0c5c4931d 100644 --- a/core/container/priority_queue/priority_queue.odin +++ b/core/container/priority_queue/priority_queue.odin @@ -85,7 +85,6 @@ _shift_down :: proc(pq: ^$Q/Priority_Queue($T), i0, n: int) -> bool { _shift_up :: proc(pq: ^$Q/Priority_Queue($T), j: int) { j := j queue := pq.queue[:] - n := builtin.len(queue) for 0 <= j { i := (j-1)/2 if i == j || !pq.less(queue[j], queue[i]) { diff --git a/core/reflect/types.odin b/core/reflect/types.odin index edd4f7a26..f53b18e0d 100644 --- a/core/reflect/types.odin +++ b/core/reflect/types.odin @@ -302,6 +302,11 @@ is_dynamic_map :: proc(info: ^Type_Info) -> bool { _, ok := type_info_base(info).variant.(Type_Info_Map) return ok } +is_bit_set :: proc(info: ^Type_Info) -> bool { + if info == nil { return false } + _, ok := type_info_base(info).variant.(Type_Info_Bit_Set) + return ok +} is_slice :: proc(info: ^Type_Info) -> bool { if info == nil { return false } _, ok := type_info_base(info).variant.(Type_Info_Slice) |