Browse Source

Improved codegen in ImageSharp.Guard

js/color-alpha-handling
Sergio Pedri 6 years ago
parent
commit
f446f2513c
  1. 6
      src/ImageSharp/Common/Helpers/Guard.cs

6
src/ImageSharp/Common/Helpers/Guard.cs

@ -20,10 +20,12 @@ namespace SixLabors
[MethodImpl(InliningOptions.ShortMethod)]
public static void MustBeValueType<TValue>(TValue value, string parameterName)
{
if (!value.GetType().GetTypeInfo().IsValueType)
if (value.GetType().GetTypeInfo().IsValueType)
{
ThrowHelper.ThrowArgumentException("Type must be a struct.", parameterName);
return;
}
ThrowHelper.ThrowArgumentException("Type must be a struct.", parameterName);
}
}
}

Loading…
Cancel
Save