aboutsummaryrefslogtreecommitdiff
path: root/zencore
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-11-18 14:26:39 +0100
committerDan Engelbrecht <[email protected]>2022-11-25 10:17:34 +0100
commitf39cd9252addfa2d55d92bebc671746c4f766b37 (patch)
tree2c9addc0da0c756caca96b30d12eec7ffd150e55 /zencore
parentreduce parsing of compressed headers (diff)
downloadzen-de/compressed-buffer-creation-opts.tar.xz
zen-de/compressed-buffer-creation-opts.zip
create matching number of asio worker thread as UE has in client connectionsde/compressed-buffer-creation-opts
Diffstat (limited to 'zencore')
-rw-r--r--zencore/include/zencore/intmath.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/zencore/include/zencore/intmath.h b/zencore/include/zencore/intmath.h
index f24caed6e..608ce2962 100644
--- a/zencore/include/zencore/intmath.h
+++ b/zencore/include/zencore/intmath.h
@@ -176,6 +176,12 @@ Max(auto x, auto y)
return x > y ? x : y;
}
+constexpr auto
+Clamp(auto x, auto l, auto h)
+{
+ return x < l ? l : x < h ? x : h;
+}
+
//////////////////////////////////////////////////////////////////////////
void intmath_forcelink(); // internal