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

◆ Overlaps< T >() [1/4]

static bool System.MemoryExtensions.Overlaps< T > ( this ReadOnlySpan< T > span,
ReadOnlySpan< T > other )
inlinestatic

Definition at line 1180 of file MemoryExtensions.cs.

1181 {
1182 if (span.IsEmpty || other.IsEmpty)
1183 {
1184 return false;
1185 }
1186 IntPtr intPtr = Unsafe.ByteOffset(ref MemoryMarshal.GetReference(span), ref MemoryMarshal.GetReference(other));
1187 if (Unsafe.SizeOf<IntPtr>() == 4)
1188 {
1189 if ((uint)(int)intPtr >= (uint)(span.Length * Unsafe.SizeOf<T>()))
1190 {
1191 return (uint)(int)intPtr > (uint)(-(other.Length * Unsafe.SizeOf<T>()));
1192 }
1193 return true;
1194 }
1195 if ((ulong)(long)intPtr >= (ulong)((long)span.Length * (long)Unsafe.SizeOf<T>()))
1196 {
1197 return (ulong)(long)intPtr > (ulong)(-((long)other.Length * (long)Unsafe.SizeOf<T>()));
1198 }
1199 return true;
1200 }

References System.other.