From c10013f444e5b52f5150c47fb49c79d8f0599917 Mon Sep 17 00:00:00 2001 From: Biao Li Date: Fri, 16 Jun 2017 10:56:40 -0700 Subject: [PATCH] Remove unreachable code block for collection reader. --- src/Microsoft.OData.Core/ODataCollectionReaderCore.cs | 5 ----- src/Microsoft.OData.Core/ODataCollectionReaderCoreAsync.cs | 5 ----- 2 files changed, 10 deletions(-) diff --git a/src/Microsoft.OData.Core/ODataCollectionReaderCore.cs b/src/Microsoft.OData.Core/ODataCollectionReaderCore.cs index 2052f60cd2..14fec8660b 100644 --- a/src/Microsoft.OData.Core/ODataCollectionReaderCore.cs +++ b/src/Microsoft.OData.Core/ODataCollectionReaderCore.cs @@ -208,11 +208,6 @@ protected bool ReadImplementation() result = this.ReadAtCollectionEndImplementation(); break; - case ODataCollectionReaderState.Exception: // fall through - case ODataCollectionReaderState.Completed: - Debug.Assert(false, "This case should have been caught earlier."); - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataCollectionReaderCore_ReadImplementation)); - default: Debug.Assert(false, "Unsupported collection reader state " + this.State + " detected."); throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataCollectionReaderCore_ReadImplementation)); diff --git a/src/Microsoft.OData.Core/ODataCollectionReaderCoreAsync.cs b/src/Microsoft.OData.Core/ODataCollectionReaderCoreAsync.cs index 79703d1982..1ef09e1d1f 100644 --- a/src/Microsoft.OData.Core/ODataCollectionReaderCoreAsync.cs +++ b/src/Microsoft.OData.Core/ODataCollectionReaderCoreAsync.cs @@ -86,11 +86,6 @@ protected override Task ReadAsynchronously() case ODataCollectionReaderState.CollectionEnd: return this.ReadAtCollectionEndImplementationAsync(); - case ODataCollectionReaderState.Exception: // fall through - case ODataCollectionReaderState.Completed: - Debug.Assert(false, "This case should have been caught earlier."); - return TaskUtils.GetFaultedTask(new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataCollectionReaderCoreAsync_ReadAsynchronously))); - default: Debug.Assert(false, "Unsupported collection reader state " + this.State + " detected."); return TaskUtils.GetFaultedTask(new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataCollectionReaderCoreAsync_ReadAsynchronously)));