git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commitf43112b98db70d14e41fd425fdaf994a9c4cc0de
parent5f02226dd9
authorIsaac Freund <[email protected]>
date2020-03-29 14:08
Add a couple utility functions

Forgot to commit this new file in a previous commit

 src/util.zig | 7 +++++++
 1 file changed, 7 insertions(+)

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;
+}