File tree 2 files changed +3
-5
lines changed
crates/oxc_linter/src/service
2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ impl Runner for LintRunner {
186
186
// e.g. `/some/file.js` and `/some/other/file.js` would both result in `/some`
187
187
let mut directories = FxHashSet :: default ( ) ;
188
188
for path in & paths {
189
- let path = Path :: new ( path. as_ref ( ) ) ;
189
+ let path = Path :: new ( path) ;
190
190
if let Some ( directory) = path. parent ( ) {
191
191
// NOTE: Initial benchmarking showed that it was faster to iterate over the directories twice
192
192
// rather than constructing the configs in one iteration. It's worth re-benchmarking that though.
Original file line number Diff line number Diff line change @@ -112,8 +112,7 @@ struct ModuleToLint {
112
112
}
113
113
impl ModuleToLint {
114
114
fn from_processed_module ( path : Arc < OsStr > , processed_module : ProcessedModule ) -> Option < Self > {
115
- let content = processed_module. content ?;
116
- Some ( Self {
115
+ processed_module. content . map ( |content| Self {
117
116
path,
118
117
section_module_records : processed_module
119
118
. section_module_records
@@ -135,7 +134,6 @@ impl Runtime {
135
134
paths : options. paths . iter ( ) . cloned ( ) . collect ( ) ,
136
135
linter,
137
136
resolver,
138
-
139
137
#[ cfg( test) ]
140
138
test_source : std:: sync:: RwLock :: new ( None ) ,
141
139
}
@@ -279,7 +277,7 @@ impl Runtime {
279
277
let mut module_paths_and_resolved_requests =
280
278
Vec :: < ( Arc < OsStr > , SmallVec < [ Vec < ResolvedModuleRequest > ; 1 ] > ) > :: new ( ) ;
281
279
282
- // There are two kinds of threads. Let's call them the graph thread and module threads.
280
+ // There are two sets of threads: threads for the graph and threads for the modules .
283
281
// - The graph thread is the one thread that calls `resolve_modules`. It's the only thread that updates the module graph, so no need for locks.
284
282
// - Module threads accept paths and produces `ModuleProcessOutput` (the logic is in `self.process_path`). They are isolated to each
285
283
// other and paralleled in the rayon thread pool.
You can’t perform that action at this time.
0 commit comments