Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove AsParallel() when mapping over the results in mergeMultipleFormatResults() #2820

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [6.0.0-alpha-010] - 2023-04-03

### Fixed
* Fix a performance regression. [#2820](https://github.com/fsprojects/fantomas/pull/2820)

## [6.0.0-alpha-009] - 2023-03-31

### Fixed
Expand Down
14 changes: 6 additions & 8 deletions src/Fantomas.Core/MultipleDefineCombinations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,12 @@ let splitWhenHash (defines: DefineCombination) (newline: string) (source: string
let mergeMultipleFormatResults config (results: (DefineCombination * FormatResult) list) : FormatResult =
let allInFragments: FormatResultForDefines list =
results
.AsParallel()
.Select(fun (dc, result) ->
let fragments = splitWhenHash dc config.EndOfLine.NewLineString result.Code

{ Result = result
Defines = dc
Fragments = fragments })
|> Seq.toList
|> List.map (fun (dc, result) ->
let fragments = splitWhenHash dc config.EndOfLine.NewLineString result.Code

{ Result = result
Defines = dc
Fragments = fragments })

let allHaveSameFragmentCount =
let allWithCount = List.map (fun { Fragments = f } -> f.Length) allInFragments
Expand Down