diff options
author | Justin Van Patten <jvp@justinvp.com> | 2015-11-28 18:05:39 +0300 |
---|---|---|
committer | Justin Van Patten <jvp@justinvp.com> | 2015-11-28 18:05:39 +0300 |
commit | 06cf3e6e24a30b90c2fcf75729252765cd0d67c5 (patch) | |
tree | af432cb8f69a694680839ac5104f8410dab16596 /src/System.Private.CoreLib | |
parent | b0c745be2118e42a29ab36fde5822105e7c6a659 (diff) |
Remove duplicate code in CharEnumerator
Change IEnumerator.Current to simply return Current, instead of
having duplicate code in both properties.
Diffstat (limited to 'src/System.Private.CoreLib')
-rw-r--r-- | src/System.Private.CoreLib/src/System/CharEnumerator.cs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/System.Private.CoreLib/src/System/CharEnumerator.cs b/src/System.Private.CoreLib/src/System/CharEnumerator.cs index b11309dd4..1e8b9ee02 100644 --- a/src/System.Private.CoreLib/src/System/CharEnumerator.cs +++ b/src/System.Private.CoreLib/src/System/CharEnumerator.cs @@ -55,15 +55,7 @@ namespace System /// <internalonly/> Object IEnumerator.Current { - get - { - if (_index == -1) - throw new InvalidOperationException(SR.InvalidOperation_EnumNotStarted); - if (_index >= _str.Length) - throw new InvalidOperationException(SR.InvalidOperation_EnumEnded); - - return _currentElement; - } + get { return Current; } } public char Current |