diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 0c657c51eb..ea2d28a567 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -299,6 +299,13 @@ namespace OpenSim.Framework x; } + // Inclusive, within range test (true if equal to the endpoints) + public static bool InRange(T x, T min, T max) + where T : IComparable + { + return x.CompareTo(max) <= 0 && x.CompareTo(min) >= 0; + } + public static uint GetNextXferID() { uint id = 0;