UnityEditor.SerializedMinMaxCurve.GetMaxKeyValue C# (CSharp) Method

GetMaxKeyValue() private method

private GetMaxKeyValue ( Keyframe keyFrames ) : float
keyFrames UnityEngine.Keyframe
return float
        private float GetMaxKeyValue(Keyframe[] keyFrames)
        {
            float negativeInfinity = float.NegativeInfinity;
            float positiveInfinity = float.PositiveInfinity;
            foreach (Keyframe keyframe in keyFrames)
            {
                if (keyframe.value > negativeInfinity)
                {
                    negativeInfinity = keyframe.value;
                }
                if (keyframe.value < positiveInfinity)
                {
                    positiveInfinity = keyframe.value;
                }
            }
            if (Mathf.Abs(positiveInfinity) > negativeInfinity)
            {
                return positiveInfinity;
            }
            return negativeInfinity;
        }