Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite789aca

Browse files
committed
FX_NO_BASED_ARRAYS --- dead code removal
1 parent75e37cd commite789aca

File tree

3 files changed

+4
-30
lines changed

3 files changed

+4
-30
lines changed

‎src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/Array2Module.fs‎

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,12 @@ type Array2Module() =
3030
if i=0then System.Math.Sin(arg)else System.Math.Cos(arg))
3131
letresultInt= Array2D.base1 intArr
3232
if resultInt<>0then Assert.Fail()
33-
#if FX_NO_BASED_ARRAYS
34-
#else
33+
3534
// string array
3635
letstrArr= Array2D.createBased0023"goodboy"
3736
letresultStr= Array2D.base1 strArr
3837
if resultStr<>0then Assert.Fail()
39-
#endif
40-
38+
4139
// empty array
4240
leteptArr= Array2D.create001
4341
letresultEpt= Array2D.base1 eptArr
@@ -60,13 +58,11 @@ type Array2Module() =
6058
letresultInt= Array2D.base2 intArr
6159
if resultInt<>0then Assert.Fail()
6260

63-
#if!FX_NO_BASED_ARRAYS
6461
// string array
6562
letstrArr= Array2D.createBased0023"goodboy"
6663
letresultStr= Array2D.base2 strArr
6764
if resultStr<>0then Assert.Fail()
68-
#endif
69-
65+
7066
// empty array
7167
leteptArr= Array2D.create001
7268
letresultEpt= Array2D.base2 eptArr
@@ -76,13 +72,11 @@ type Array2Module() =
7672
letnullArr=null:string[,]
7773
CheckThrowsNullRefException(fun()-> Array2D.base2 nullArr|> ignore)
7874

79-
#if!FX_NO_BASED_ARRAYS
8075
// Verify printing format of non-zero based arrays
8176
letv:int[,]= Array2D.createBased101342
8277
letactual=(sprintf"%A" v).Replace("\r","").Replace("\n","")
8378
letexpected="[bound1=10 bound2=1 [2; 2; 2; 2] [2; 2; 2; 2] [2; 2; 2; 2]]"
8479
Assert.AreEqual(expected, actual)
85-
#endif
8680
()
8781

8882
[<Test>]
@@ -131,7 +125,6 @@ type Array2Module() =
131125
CheckThrowsArgumentException(fun()-> Array2D.blit intArr00 intArr201022|> ignore)
132126
()
133127

134-
#if!FX_NO_BASED_ARRAYS
135128
[<Test>]
136129
memberthis.BlitWithNonZeroBase()=
137130
leta= Array2D.createBased11330
@@ -184,7 +177,6 @@ type Array2Module() =
184177
CheckThrowsArgumentException(fun()-> Array2D.blit a11 b1144|> ignore)
185178

186179
()
187-
#endif
188180

189181
[<Test>]
190182
memberthis.Copy()=
@@ -230,7 +222,6 @@ type Array2Module() =
230222

231223
()
232224

233-
#if!FX_NO_BASED_ARRAYS
234225
[<Test>]
235226
memberthis.createBased()=
236227
// integer array
@@ -249,7 +240,6 @@ type Array2Module() =
249240
letresultEpt= Array2D.createBased00001
250241
if resultEpt<> eptArrthen Assert.Fail()
251242
()
252-
#endif
253243

254244
[<Test>]
255245
memberthis.Get()=
@@ -285,26 +275,21 @@ type Array2Module() =
285275
letintArr= Array2D.init23(fun i j-> i*100+ j)
286276
if intArr.[1,1]<>101then Assert.Fail()
287277

288-
289278
// string array
290279
letstrArr= Array2D.init23(fun i j-> i.ToString()+"-"+ j.ToString())
291280
if strArr.[1,1]<>"1-1"then Assert.Fail()
292281
()
293-
294-
#if!FX_NO_BASED_ARRAYS
282+
295283
[<Test>]
296284
memberthis.Init_Based()=
297285
// integer array
298286
letintArr= Array2D.initBased1123(fun i j-> i*100+ j)
299287
if intArr.[2,2]<>202then Assert.Fail()
300288

301-
302289
// string array
303290
letstrArr= Array2D.initBased1123(fun i j-> i.ToString()+"-"+ j.ToString())
304291
if strArr.[2,2]<>"2-2"then Assert.Fail()
305-
306292
()
307-
#endif
308293

309294
[<Test>]
310295
memberthis.Iter()=
@@ -331,7 +316,6 @@ type Array2Module() =
331316
CheckThrowsArgumentNullException(fun()-> Array2D.iter funStr nullArr|> ignore)
332317
()
333318

334-
#if!FX_NO_BASED_ARRAYS
335319
[<Test>]
336320
memberthis.IterNonZeroBased()=
337321
leta= Array2D.createBased1510101
@@ -343,8 +327,6 @@ type Array2Module() =
343327
if!result<>1600then Assert.Fail()
344328
()
345329

346-
#endif
347-
348330
[<Test>]
349331
memberthis.Iteri()=
350332
// integer array
@@ -470,7 +452,6 @@ type Array2Module() =
470452

471453
()
472454

473-
#if!FX_NO_BASED_ARRAYS
474455
[<Test>]
475456
memberthis.Rebase()=
476457
// integer array
@@ -494,7 +475,6 @@ type Array2Module() =
494475
CheckThrowsArgumentNullException(fun()-> Array2D.rebase nullArr|> ignore)
495476

496477
()
497-
#endif
498478

499479
[<Test>]
500480
memberthis.Set()=

‎src/fsharp/FSharp.Core/array2.fs‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@ namespace Microsoft.FSharp.Collections
5151
(System.Array.CreateInstance(typeof<'T>,[|n1;n2|]):?> 'T[,])
5252
#endif
5353
else
54-
#if FX_NO_BASED_ARRAYS
55-
raise(NotSupportedException(SR.GetString(SR.nonZeroBasedDisallowed)))
56-
#else
5754
(Array.CreateInstance(typeof<'T>,[|n1;n2|],[|b1;b2|]):?> 'T[,])
58-
#endif
5955

6056
[<CompiledName("CreateBased")>]
6157
letcreateBased b1 b2 n m(x:'T)=

‎src/fsharp/FSharp.Core/array2.fsi‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ namespace Microsoft.FSharp.Collections
9595
[<CompiledName("ZeroCreate")>]
9696
valzeroCreate:length1:int->length2:int->'T[,]
9797

98-
#if!FX_NO_BASED_ARRAYS
9998
/// <summary>Creates a based array given the dimensions and a generator function to compute the elements.</summary>
10099
///
101100
/// <param name="base1">The base for the first dimension of the array.</param>
@@ -133,7 +132,6 @@ namespace Microsoft.FSharp.Collections
133132
/// <exception cref="System.ArgumentException">Thrown when base1, base2, length1, or length2 is negative.</exception>
134133
[<CompiledName("ZeroCreateBased")>]
135134
valzeroCreateBased:base1:int->base2:int->length1:int->length2:int->'T[,]
136-
#endif
137135

138136
/// <summary>Applies the given function to each element of the array.</summary>
139137
///

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp