You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If all items in the enum are of the same type, then we can build a special validator for this type, in this case, we can speed up validation because for not matching types we won't need comparisons at all and for matching types, we'll have some improvement as well - we can store unwrapped values, unwrap the input value once during the matching step and then compare them in a loop, which should be faster.
{"enum": [1, 2, 3, 4, 5]}
If the input instance is "foo", then we don't need to iterate over all variants, we can return false immediately. The trick will work only for homogenous arrays
The text was updated successfully, but these errors were encountered:
If all items in the enum are of the same type, then we can build a special validator for this type, in this case, we can speed up validation because for not matching types we won't need comparisons at all and for matching types, we'll have some improvement as well - we can store unwrapped values, unwrap the input value once during the matching step and then compare them in a loop, which should be faster.
If the input instance is
"foo"
, then we don't need to iterate over all variants, we can returnfalse
immediately. The trick will work only for homogenous arraysThe text was updated successfully, but these errors were encountered: