Replace x in &y Use &v in y syntax through core & vendor for switch/for statements

This commit is contained in:
gingerBill
2023-06-26 15:42:57 +01:00
parent 00d60e28c2
commit 3dec55f009
14 changed files with 33 additions and 33 deletions
+3 -3
View File
@@ -19,7 +19,7 @@ import rnd "core:math/rand"
int_destroy :: proc(integers: ..^Int) {
integers := integers
for a in &integers {
for a in integers {
assert_if_nil(a)
}
#force_inline internal_int_destroy(..integers)
@@ -408,7 +408,7 @@ clear_if_uninitialized_multi :: proc(args: ..^Int, allocator := context.allocato
args := args
assert_if_nil(..args)
for i in &args {
for i in args {
#force_inline internal_clear_if_uninitialized_single(i, allocator) or_return
}
return err
@@ -435,7 +435,7 @@ int_init_multi :: proc(integers: ..^Int, allocator := context.allocator) -> (err
assert_if_nil(..integers)
integers := integers
for a in &integers {
for a in integers {
#force_inline internal_clear(a, true, allocator) or_return
}
return nil
+2 -2
View File
@@ -1857,7 +1857,7 @@ internal_root_n :: proc { internal_int_root_n, }
internal_int_destroy :: proc(integers: ..^Int) {
integers := integers
for a in &integers {
for &a in integers {
if internal_int_allocated_cap(a) > 0 {
mem.zero_slice(a.digit[:])
free(&a.digit[0])
@@ -2909,7 +2909,7 @@ internal_int_init_multi :: proc(integers: ..^Int, allocator := context.allocator
context.allocator = allocator
integers := integers
for a in &integers {
for a in integers {
internal_clear(a) or_return
}
return nil
+1 -1
View File
@@ -137,7 +137,7 @@ rat_copy :: proc(dst, src: ^Rat, minimize := false, allocator := context.allocat
internal_rat_destroy :: proc(rationals: ..^Rat) {
rationals := rationals
for z in &rationals {
for &z in rationals {
internal_int_destroy(&z.a, &z.b)
}
}
+1 -1
View File
@@ -450,7 +450,7 @@ flux_tween_init :: proc(tween: ^Flux_Tween($T), duration: time.Duration) where i
flux_update :: proc(flux: ^Flux_Map($T), dt: f64) where intrinsics.type_is_float(T) {
clear(&flux.keys_to_be_deleted)
for key, tween in &flux.values {
for key, &tween in flux.values {
delay_remainder := f64(0)
// Update delay if necessary.