protected private override void convertSpanImpl(ReadOnlySpan <T?> src, Span <string?> dst) { for (int i = 0; i < src.Length; i++) { dst[i] = ASObject.AS_coerceString((ASObject?)(object?)src[i]); } }
public override int lastIndexOf(ReadOnlySpan <T> span, T item) { if (item == null || !s_typeHasSpecialStrictEq || !ClassTagSet.specialStrictEquality.contains(item.AS_class.tag)) { for (int i = span.Length - 1; i >= 0; i--) { if (span[i] == item) { return(i); } } } else if (ASObject.AS_isNumeric(item)) { double itemVal = ASObject.AS_toNumber(item); for (int i = span.Length - 1; i >= 0; i--) { if (ASObject.AS_isNumeric(span[i]) && ASObject.AS_toNumber(span[i]) == itemVal) { return(i); } } } else if (item is ASString) { string itemVal = ASObject.AS_coerceString(item); for (int i = span.Length - 1; i >= 0; i--) { if (span[i] is ASString && ASObject.AS_coerceString(span[i]) == itemVal) { return(i); } } } else { for (int i = span.Length - 1; i >= 0; i--) { if (ASObject.AS_strictEq(span[i], item)) { return(i); } } } return(-1); }
public override string?convert(T?value) => ASObject.AS_coerceString((ASObject?)(object?)value);