diff options
author | Marek Safar <marek.safar@gmail.com> | 2018-01-04 18:38:18 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2018-01-10 16:41:59 +0300 |
commit | 6aa4e4dac90f83424b35ce8f98a96090c9e76bbc (patch) | |
tree | a5070a225a14f62f6a4329da55d3e056d15666d4 /mcs/class/referencesource | |
parent | e9913fdc487622073a0827f32f845b637163590d (diff) |
[corlib] Optimizes non-intrinsics version of string indexer code
Diffstat (limited to 'mcs/class/referencesource')
-rw-r--r-- | mcs/class/referencesource/mscorlib/system/string.cs | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/mcs/class/referencesource/mscorlib/system/string.cs b/mcs/class/referencesource/mscorlib/system/string.cs index 79e71f969cd..4f1214b31d4 100644 --- a/mcs/class/referencesource/mscorlib/system/string.cs +++ b/mcs/class/referencesource/mscorlib/system/string.cs @@ -668,20 +668,11 @@ namespace System { return !String.Equals(a, b); } +#if !MONO // Gets the character at a specified position. // // Spec#: Apply the precondition here using a contract assembly. Potential perf issue. [System.Runtime.CompilerServices.IndexerName("Chars")] -#if MONO - public unsafe char this[int index] { - get { - if (index < 0 || index >= m_stringLength) - throw new IndexOutOfRangeException (); - fixed (char* c = &m_firstChar) - return c[index]; - } - } -#else public extern char this[int index] { [ResourceExposure(ResourceScope.None)] [MethodImpl(MethodImplOptions.InternalCall)] |