Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #201 from fedotovalex/fix-200
Browse files Browse the repository at this point in the history
Corrected contracts of string.IndexOfAny(char[], ...)
  • Loading branch information
SergeyTeplyakov committed Aug 10, 2015
2 parents 270f54d + 8e67b6e commit 0fbc6e0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Microsoft.Research/Contracts/MsCorlib/System.String.cs
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ public int IndexOfAny(char[] anyOf, int startIndex)
Contract.Requires(anyOf != null);

Contract.Requires(startIndex >= 0);
Contract.Requires(startIndex < Length);
Contract.Requires(startIndex <= Length);

Contract.Ensures(-1 <= Contract.Result<int>());
Contract.Ensures(Contract.Result<int>() < this.Length);
Expand All @@ -795,8 +795,7 @@ public int IndexOfAny(char[] anyOf, int startIndex, int count)

Contract.Requires(startIndex >= 0);
Contract.Requires(count >= 0);

Contract.Requires(startIndex + count < Length);
Contract.Requires(startIndex + count <= Length);

Contract.Ensures(-1 <= Contract.Result<int>());
Contract.Ensures(Contract.Result<int>() < this.Length);
Expand Down

0 comments on commit 0fbc6e0

Please sign in to comment.