mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 16:18:52 +00:00
Use builtin.min and builtin.max in package slice
This commit is contained in:
@@ -299,7 +299,7 @@ min :: proc(s: $S/[]$T) -> (res: T, ok: bool) where intrinsics.type_is_ordered(T
|
|||||||
res = s[0];
|
res = s[0];
|
||||||
ok = true;
|
ok = true;
|
||||||
for v in s[1:] {
|
for v in s[1:] {
|
||||||
res = min(res, v);
|
res = builtin.min(res, v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -309,7 +309,7 @@ max :: proc(s: $S/[]$T) -> (res: T, ok: bool) where intrinsics.type_is_ordered(T
|
|||||||
res = s[0];
|
res = s[0];
|
||||||
ok = true;
|
ok = true;
|
||||||
for v in s[1:] {
|
for v in s[1:] {
|
||||||
res = max(res, v);
|
res = builtin.max(res, v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user