Skip to content

Commit

Permalink
simplified if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
NaluTripician committed Mar 6, 2023
1 parent 87416c3 commit 73771ba
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Microsoft.Azure.Cosmos/src/Handler/RequestInvokerHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -500,11 +500,10 @@ internal static async Task<FeedRange> ResolveFeedRangeBasedOnPrefixContainerAsyn
.GetPartitionKeyDefinitionAsync(cancellationToken)
.ConfigureAwait(false);

if (partitionKeyDefinition != null && partitionKeyDefinition.Kind == PartitionKind.MultiHash)
if (partitionKeyDefinition != null && partitionKeyDefinition.Kind == PartitionKind.MultiHash
&& feedRangePartitionKey.PartitionKey.InternalKey?.Components?.Count >= partitionKeyDefinition.Paths?.Count)
{
return feedRangePartitionKey.PartitionKey.InternalKey?.Components?.Count >= partitionKeyDefinition.Paths?.Count
? feedRange
: new FeedRangeEpk(feedRangePartitionKey.PartitionKey.InternalKey.GetEPKRangeForPrefixPartitionKey(partitionKeyDefinition));
feedRange = new FeedRangeEpk(feedRangePartitionKey.PartitionKey.InternalKey.GetEPKRangeForPrefixPartitionKey(partitionKeyDefinition));
}
}

Expand Down

0 comments on commit 73771ba

Please sign in to comment.