Skip to content

Commit

Permalink
Revert to all old code
Browse files Browse the repository at this point in the history
  • Loading branch information
latkin committed Jun 12, 2015
1 parent 9cf81de commit a24d85b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/fsharp/FSharp.Core/array.fs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ namespace Microsoft.FSharp.Collections
[<CompiledName("Head")>]
let head (array : 'T[]) =
checkNonNull "array" array
if array.Length = 0 then invalidArg "array" (SR.GetString(SR.arrayWasEmpty)) else array.[0]
if array.Length = 0 then invalidArg "array" LanguagePrimitives.ErrorStrings.InputArrayEmptyString else array.[0]

[<CompiledName("Copy")>]
let copy (array: 'T[]) =
Expand Down Expand Up @@ -754,7 +754,7 @@ namespace Microsoft.FSharp.Collections
checkNonNull "array" array
let len = array.Length
if len = 0 then
invalidArg "array" (SR.GetString(SR.arrayWasEmpty))
invalidArg "array" LanguagePrimitives.ErrorStrings.InputArrayEmptyString
else
let f = OptimizedClosures.FSharpFunc<_,_,_>.Adapt(f)
let mutable res = array.[0]
Expand All @@ -766,7 +766,7 @@ namespace Microsoft.FSharp.Collections
let reduceBack f (array : _[]) =
checkNonNull "array" array
let len = array.Length
if len = 0 then invalidArg "array" (SR.GetString(SR.arrayWasEmpty))
if len = 0 then invalidArg "array" LanguagePrimitives.ErrorStrings.InputArrayEmptyString
else foldSubRight f array 0 (len - 2) array.[len - 1]

[<CompiledName("SortInPlaceWith")>]
Expand Down Expand Up @@ -995,7 +995,7 @@ namespace Microsoft.FSharp.Collections
let exactlyOne (array:'T[]) =
checkNonNull "array" array
if array.Length = 1 then array.[0]
elif array.Length = 0 then invalidArg "array" (SR.GetString(SR.inputSequenceEmpty))
elif array.Length = 0 then invalidArg "array" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString
else invalidArg "array" (SR.GetString(SR.inputSequenceTooLong))

[<CompiledName("Truncate")>]
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/FSharp.Core/list.fs
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ namespace Microsoft.FSharp.Collections
let exactlyOne (source : list<_>) =
match source with
| [x] -> x
| [] -> invalidArg "source" (SR.GetString(SR.inputSequenceEmpty))
| [] -> invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString
| _ -> invalidArg "source" (SR.GetString(SR.inputSequenceTooLong))

[<CompiledName("Truncate")>]
Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/FSharp.Core/local.fs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ module internal List =


let init count f =
if count < 0 then invalidArg "count" (SR.GetString(SR.inputMustBeNonNegative))
if count < 0 then invalidArg "count" LanguagePrimitives.ErrorStrings.InputMustBeNonNegativeString
if count = 0 then []
else
let res = freshConsNoTail (f 0)
Expand All @@ -343,7 +343,7 @@ module internal List =
takeFreshConsTail cons2 (n - 1) xs

let take n l =
if n < 0 then invalidArg "count" (SR.GetString(SR.inputMustBeNonNegative))
if n < 0 then invalidArg "count" LanguagePrimitives.ErrorStrings.InputMustBeNonNegativeString
if n = 0 then [] else
match l with
| [] -> raise <| System.InvalidOperationException (SR.GetString(SR.notEnoughElements))
Expand Down
10 changes: 5 additions & 5 deletions src/fsharp/FSharp.Core/seq.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,7 @@ namespace Microsoft.FSharp.Collections
let reduce f (source : seq<'T>) =
checkNonNull "source" source
use e = source.GetEnumerator()
if not (e.MoveNext()) then invalidArg "source" (SR.GetString(SR.inputSequenceEmpty));
if not (e.MoveNext()) then invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString;
let f = OptimizedClosures.FSharpFunc<_,_,_>.Adapt(f)
let mutable state = e.Current
while e.MoveNext() do
Expand Down Expand Up @@ -1264,7 +1264,7 @@ namespace Microsoft.FSharp.Collections
checkNonNull "source" source
let arr = toArray source
match arr.Length with
| 0 -> invalidArg "source" (SR.GetString(SR.inputSequenceEmpty))
| 0 -> invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString
| len ->
let f = OptimizedClosures.FSharpFunc<_,_,_>.Adapt(f)
foldArraySubRight f arr 0 (len - 2) arr.[len - 1]
Expand Down Expand Up @@ -1734,7 +1734,7 @@ namespace Microsoft.FSharp.Collections
checkNonNull "source" source
use e = source.GetEnumerator()
if (e.MoveNext()) then e.Current
else invalidArg "source" (SR.GetString(SR.inputSequenceEmpty))
else invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString

[<CompiledName("TryHead")>]
let tryHead (source : seq<_>) =
Expand All @@ -1761,7 +1761,7 @@ namespace Microsoft.FSharp.Collections
while (e.MoveNext()) do res <- e.Current
res
else
invalidArg "source" (SR.GetString(SR.inputSequenceEmpty))
invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString

[<CompiledName("TryLast")>]
let tryLast (source : seq<_>) =
Expand All @@ -1785,7 +1785,7 @@ namespace Microsoft.FSharp.Collections
else
v
else
invalidArg "source" (SR.GetString(SR.inputSequenceEmpty))
invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString

[<CompiledName("Reverse")>]
let rev source =
Expand Down

0 comments on commit a24d85b

Please sign in to comment.