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

Commita11ac80

Browse files
authored
Merge pull request #3147 from forki/patch-30
Remove weird recursive function
2 parents110dc70 +a6bdafb commita11ac80

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

‎src/fsharp/Optimizer.fs‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,20 +197,18 @@ type Summary<'Info> =
197197
// Note, this is a different notion of "size" to the one used for inlining heuristics
198198
//-------------------------------------------------------------------------
199199

200-
let recSizeOfValueInfos(arr:_[])=
201-
letn= arr.Length
202-
let recgo i acc=if i>= nthen accelse max acc(SizeOfValueInfo arr.[i])
203-
go00
200+
let recSizeOfValueInfos(arr:_[])=
201+
if arr.Length<=0then0else max0(SizeOfValueInfo arr.[0])
204202

205203
andSizeOfValueInfo x=
206204
match xwith
207205
| SizeValue(vdepth,_v)-> vdepth(* terminate recursion at CACHED size nodes*)
208206
| ConstValue(_x,_)->1
209207
| UnknownValue->1
210208
| ValValue(_vr,vinfo)-> SizeOfValueInfo vinfo+1
211-
| TupleValue vinfos
209+
| TupleValue vinfos
212210
| RecdValue(_,vinfos)
213-
| UnionCaseValue(_,vinfos)->1+ SizeOfValueInfos vinfos
211+
| UnionCaseValue(_,vinfos)->1+ SizeOfValueInfos vinfos
214212
| CurriedLambdaValue(_lambdaId,_arities,_bsize,_expr',_ety)->1
215213
| ConstExprValue(_size,_)->1
216214

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp