Improve Annotated Scarpet runtime performance (#1273)

- Change valueConverters list to array

- Remove references to `Class.cast` and use direct casts instead
This commit is contained in:
altrisi authored and GitHub committed 2022-01-29 23:44:50 +01:00
1 parent 82bdd5e61c
commit 50c70de7e5
3 files changed
+15 -17

No files matched your search

@@ -77,11 +77,12 @@ public final class ValueCaster<R> implements ValueConverter<R> // R always exten
}
@Override
@SuppressWarnings("unchecked") // more than checked, see SimpleTypeConverter#converter for reasoning
public R convert(Value value)
{
if (!outputType.isInstance(value))
return null;
return outputType.cast(value);
return (R)value;
}
/**