Improve pref of `Array.IndexOf()` for certain `T`. (#24293)
authordschinde <dschindelman@gmail.com>
Tue, 30 Apr 2019 00:38:49 +0000 (19:38 -0500)
committerJan Kotas <jkotas@microsoft.com>
Tue, 30 Apr 2019 00:38:49 +0000 (17:38 -0700)
commit2551753281ce89be4321c3d23111db6c6b7e77c0
treec68029569a90df7320394a89e994f4886b99842f
parent3661584ffcdeac6f35fa9e2485796a482ebbf7b3
Improve pref of `Array.IndexOf()` for certain `T`. (#24293)

Applies changes to `Array.IndexOf()` and `Array.LastIndexOf()` similar
to the changes made in #20855, so that types other than `byte` and
`char` can use use the fast vectorized path.

Also allows 32-bit and 64-bit types for which
`RuntimeHelpers.IsBitwiseEquatable<T>()` returns `true` to use the
faster implementation of `IndexOf` and `LastIndexOf` from
`MemoryExtensions`.
src/System.Private.CoreLib/shared/System/Array.cs