Skip to content

Commit d7dcc36

Browse files
Remove redundant code from ArrayConverter
1 parent 560c0f2 commit d7dcc36

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
// Copyright (c) Six Labors.
1+
// Copyright (c) Six Labors.
22
// Licensed under the Apache License, Version 2.0.
33

44
using System;
55
using System.Collections.Generic;
66
using System.Globalization;
7-
using System.Linq;
87

98
namespace SixLabors.ImageSharp.Web.Commands.Converters
109
{
@@ -16,11 +15,6 @@ internal sealed class ArrayConverter<T> : ListConverter<T>
1615
{
1716
/// <inheritdoc/>
1817
public override object ConvertFrom(CultureInfo culture, string value, Type propertyType)
19-
{
20-
object result = base.ConvertFrom(culture, value, propertyType);
21-
22-
var list = result as IList<T>;
23-
return list?.ToArray() ?? result;
24-
}
18+
=> ((List<T>)base.ConvertFrom(culture, value, propertyType)).ToArray();
2519
}
26-
}
20+
}

0 commit comments

Comments
 (0)