res += 1.0f;
return res;
-}
\ No newline at end of file
+}
+
+max_poly :: proc (a: $T, b: T) -> T {
+ if a >= b do return a;
+ return b;
+}
+
+min_poly :: proc (a: $T, b: T) -> T {
+ if a <= b do return a;
+ return b;
+}
return false;
}
+// string_compare :: proc (str1: string, str2: string) -> i32 {
+// if str1.count != str2.count do return str1.count - str2.count;
+//
+// i := 0;
+// while i < str1.count && str1[i] == str2[i] do i += 1;
+//
+// if i == str1.count do return 0;
+// return ~~(str1[i] - str2[i]);
+// }
+
+string_equal :: proc (str1: string, str2: string) -> bool {
+ if str1.count != str2.count do return false;
+ while i := 0; i < str1.count {
+ if str1[i] != str2[i] do return false;
+ i += 1;
+ }
+ return true;
+}
+
string_strip_leading_whitespace :: proc (str: ^string) {
while true do switch str.data[0] {
case #char " ", #char "\t", #char "\n", #char "\r" {