servo/source/Servo.MotiveEngine/ExtensionUtils.cs

19 lines
341 B
C#
Raw Normal View History

using System;
namespace Servo.MotiveEngine
{
public static class ExtensionUtils
{
public static int MaxLimit(this int val, int max)
{
if (max < 0)
throw new ArgumentOutOfRangeException();
if (val >= max)
return max;
return val;
}
}
}