Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Contains< T >() [2/2]

static bool System.MemoryExtensions.Contains< T > ( this Span< T > span,
T value )
inlinestatic
Type Constraints
T :IEquatable<T> 

Definition at line 490 of file MemoryExtensions.cs.

491 {
492 if (RuntimeHelpers.IsBitwiseEquatable<T>())
493 {
494 if (Unsafe.SizeOf<T>() == 1)
495 {
496 return SpanHelpers.Contains(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), Unsafe.As<T, byte>(ref value), span.Length);
497 }
498 if (Unsafe.SizeOf<T>() == 2)
499 {
500 return SpanHelpers.Contains(ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)), Unsafe.As<T, char>(ref value), span.Length);
501 }
502 }
503 return SpanHelpers.Contains(ref MemoryMarshal.GetReference(span), value, span.Length);
504 }
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)

References System.SpanHelpers.Contains(), and System.value.