Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZoltan Varga <vargaz@gmail.com>2019-07-12 08:24:52 +0300
committerGitHub <noreply@github.com>2019-07-12 08:24:52 +0300
commit04034032f4c7959d58daf1eaf878ea85a80bc74d (patch)
tree49d070f336a69f51938def3582c8876a585fb441 /mcs/class/referencesource
parent537fc4b60d0783dc260b4b26b64d1fd03db52cc8 (diff)
[jit] Fix the devirt of EqualityComparer<byte>. (#15644)
* [jit] Fix the devirt of EqualityComparer<byte>. * Add a test. * Fix the tests.
Diffstat (limited to 'mcs/class/referencesource')
-rw-r--r--mcs/class/referencesource/mscorlib/system/collections/generic/equalitycomparer.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/mcs/class/referencesource/mscorlib/system/collections/generic/equalitycomparer.cs b/mcs/class/referencesource/mscorlib/system/collections/generic/equalitycomparer.cs
index 8d4470e4eb6..20299dd26d5 100644
--- a/mcs/class/referencesource/mscorlib/system/collections/generic/equalitycomparer.cs
+++ b/mcs/class/referencesource/mscorlib/system/collections/generic/equalitycomparer.cs
@@ -49,15 +49,17 @@ namespace System.Collections.Generic
Contract.Ensures(Contract.Result<EqualityComparer<T>>() != null);
RuntimeType t = (RuntimeType)typeof(T);
- // Specialize type byte for performance reasons
- if (t == typeof(byte)) {
- return (EqualityComparer<T>)(object)(new ByteEqualityComparer());
- }
/////////////////////////////////////////////////
// KEEP THIS IN SYNC WITH THE DEVIRT CODE
// IN METHOD-TO-IR.C
/////////////////////////////////////////////////
+
+ // Specialize type byte for performance reasons
+ if (t == typeof(byte)) {
+ return (EqualityComparer<T>)(object)(new ByteEqualityComparer());
+ }
+
#if MOBILE
// Breaks .net serialization compatibility
if (t == typeof (string))