Skip to content

Commit

Permalink
Avoid virtual calls. (fsprojects#2995)
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf committed Nov 21, 2023
1 parent 21bae08 commit 9370dd6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Fantomas.Core/Context.fs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ let writerEvent (e: WriterEvent) (ctx: Context) : Context =
WriterEvents = Queue.append ctx.WriterEvents evs
WriterModel =
(ctx.WriterModel, evs)
||> Seq.fold (fun m e -> WriterModel.update ctx.Config.MaxLineLength e m) }
||> List.fold (fun m e -> WriterModel.update ctx.Config.MaxLineLength e m) }

ctx'

Expand Down Expand Up @@ -430,7 +430,7 @@ let (+>) (ctx: Context -> Context) (f: _ -> Context) x =
let y = ctx x

match y.WriterModel.Mode with
| ShortExpression infos when infos |> Seq.exists (fun x -> x.ConfirmedMultiline) -> y
| ShortExpression infos when infos |> List.exists (fun x -> x.ConfirmedMultiline) -> y
| _ -> f y

let (!-) (str: string) = writerEvent (Write str)
Expand Down
2 changes: 1 addition & 1 deletion src/Fantomas.Core/Defines.fs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ module private DefineCombinationSolver =
let enforcedLit =
cnf |> List.filter (fun t -> Set.count t = 1) |> List.collect Set.toList

if groupedLiterals enforcedLit |> Seq.exists (fun (_, g) -> List.length g > 1) then
if groupedLiterals enforcedLit |> List.exists (fun (_, g) -> List.length g > 1) then
Unsatisfiable
else
let singletons, toSolve =
Expand Down

0 comments on commit 9370dd6

Please sign in to comment.