File tree Expand file tree Collapse file tree
src/FixedMathSharp/Numerics Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,7 +49,9 @@ public FixedCurve(params FixedCurveKey[] keyframes)
4949 [ MemoryPackConstructor ]
5050 public FixedCurve ( FixedCurveMode mode , params FixedCurveKey [ ] keyframes )
5151 {
52- Keyframes = keyframes . OrderBy ( k => k . Time ) . ToArray ( ) ;
52+ Keyframes = keyframes ? . Length > 1
53+ ? keyframes . OrderBy ( k => k . Time ) . ToArray ( )
54+ : keyframes ? . Clone ( ) as FixedCurveKey [ ] ?? Array . Empty < FixedCurveKey > ( ) ;
5355 Mode = mode ;
5456 }
5557
@@ -130,9 +132,9 @@ public override int GetHashCode()
130132 }
131133 }
132134
133- public static bool operator == ( FixedCurve left , FixedCurve right ) => left ? . Equals ( right ) ?? right is null ;
135+ public static bool operator == ( FixedCurve ? left , FixedCurve ? right ) => left ? . Equals ( right ) ?? right is null ;
134136
135- public static bool operator != ( FixedCurve left , FixedCurve right ) => ! ( left == right ) ;
137+ public static bool operator != ( FixedCurve ? left , FixedCurve ? right ) => ! ( left == right ) ;
136138
137139 #endregion
138140}
You can’t perform that action at this time.
0 commit comments