mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-03 14:18:47 +00:00
Make core library use procedure groupings rather than normal overloading
This commit is contained in:
+5
-3
@@ -376,7 +376,7 @@ clear_map :: inline proc "contextless" (m: ^$T/map[$K]$V) {
|
||||
|
||||
clear :: proc[clear_dynamic_array, clear_map];
|
||||
|
||||
reserve :: proc(array: ^$T/[dynamic]$E, capacity: int, loc := #caller_location) -> bool {
|
||||
reserve_dynamic_array :: proc(array: ^$T/[dynamic]$E, capacity: int, loc := #caller_location) -> bool {
|
||||
if array == nil do return false;
|
||||
a := cast(^raw.Dynamic_Array)array;
|
||||
|
||||
@@ -453,7 +453,7 @@ __get_map_key :: proc "contextless" (key: $K) -> __Map_Key {
|
||||
return map_key;
|
||||
}
|
||||
|
||||
reserve :: proc(m: ^$T/map[$K]$V, capacity: int) {
|
||||
reserve_map :: proc(m: ^$T/map[$K]$V, capacity: int) {
|
||||
if m != nil do __dynamic_map_reserve(__get_map_header(m), capacity);
|
||||
}
|
||||
|
||||
@@ -461,6 +461,8 @@ delete :: proc(m: ^$T/map[$K]$V, key: K) {
|
||||
if m != nil do __dynamic_map_delete(__get_map_header(m), __get_map_key(key));
|
||||
}
|
||||
|
||||
reserve :: proc[reserve_dynamic_array, reserve_map];
|
||||
|
||||
|
||||
|
||||
new :: inline proc(T: type, loc := #caller_location) -> ^T {
|
||||
@@ -705,7 +707,7 @@ __type_assertion_check :: proc "contextless" (ok: bool, file: string, line, colu
|
||||
}
|
||||
|
||||
__string_decode_rune :: inline proc "contextless" (s: string) -> (rune, int) {
|
||||
return utf8.decode_rune(s);
|
||||
return utf8.decode_rune_from_string(s);
|
||||
}
|
||||
|
||||
__bounds_check_error_loc :: inline proc "contextless" (using loc := #caller_location, index, count: int) {
|
||||
|
||||
Reference in New Issue
Block a user