未验证 提交 d0ad1d31 编写于 作者: S Steffen Forkmann 提交者: GitHub

Use IsNil instead of .Length (#9337)

上级 7dcfeee5
......@@ -7645,7 +7645,7 @@ let CodegenAssembly cenv eenv mgbuf fileImpls =
// top-level initialization code.
let extraBindings = mgbuf.GrabExtraBindingsToGenerate()
//printfn "#extraBindings = %d" extraBindings.Length
if extraBindings.Length > 0 then
if not (isNil extraBindings) then
let mexpr = TMDefs [ for b in extraBindings -> TMDefLet(b, range0) ]
let _emptyTopInstrs, _emptyTopCode =
CodeGenMethod cenv mgbuf ([], "unused", eenv, 0, (fun cgbuf eenv ->
......
......@@ -3887,8 +3887,8 @@ module DebugPrint =
and appL g flayout tys args =
let z = flayout
let z = if tys.Length > 0 then z ^^ instL typeL tys else z
let z = if args.Length > 0 then z --- spaceListL (List.map (atomL g) args) else z
let z = if isNil tys then z else z ^^ instL typeL tys
let z = if isNil args then z else z --- spaceListL (List.map (atomL g) args)
z
and implFileL g (TImplFile (_, _, mexpr, _, _, _)) =
......
......@@ -1479,7 +1479,7 @@ type internal FsiDynamicCompiler
for folder in result.Roots do
tcConfigB.AddIncludePath(m, folder, "")
let scripts = result.SourceFiles |> Seq.toList
if scripts |> Seq.length > 0 then
if not (isNil scripts) then
fsiDynamicCompiler.EvalSourceFiles(ctok, istate, m, scripts, lexResourceManager, errorLogger)
else istate
with _ ->
......
......@@ -181,7 +181,7 @@ module UnusedOpens =
| true, scopes -> openStatement.AppliedScope :: scopes
| _ -> [openStatement.AppliedScope]
usedModules.[openedModule.Entity] <- scopes
newlyOpenedModules.Length > 0
not (isNil newlyOpenedModules)
/// Incrementally filter out the open statements one by one. Filter those whose contents are referred to somewhere in the symbol uses.
/// Async to allow cancellation.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册