aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2020-03-29 14:08:39 +0200
committerIsaac Freund <ifreund@ifreund.xyz>2020-03-29 14:08:39 +0200
commit9d0a41c0d2d17783e16861cce6313ebc5c713252 (patch)
tree76a938cf62157791bccb32a965ac625eeb478c58
parente55d40ab106d6273cac6a304af238f8c6c1e89f7 (diff)
downloadriver-9d0a41c0d2d17783e16861cce6313ebc5c713252.tar.gz
river-9d0a41c0d2d17783e16861cce6313ebc5c713252.tar.xz
Add a couple utility functions
Forgot to commit this new file in a previous commit
-rw-r--r--src/util.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/util.zig b/src/util.zig
new file mode 100644
index 0000000..517e111
--- /dev/null
+++ b/src/util.zig
@@ -0,0 +1,7 @@
+pub fn max(comptime T: type, a: T, b: T) T {
+ return if (a > b) a else b;
+}
+
+pub fn min(comptime T: type, a: T, b: T) T {
+ return if (a < b) a else b;
+}