Skip to content

Commit 6d33d33

Browse files
tyao1facebook-github-bot
authored andcommitted
Parallelize build enums more
Reviewed By: lynnshaoyu Differential Revision: D70814981 fbshipit-source-id: 364e9c60554b550a7fa6a414c0a33ed514e4f6ae
1 parent 5184538 commit 6d33d33

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

compiler/crates/schema/src/in_memory.rs

+4
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,10 @@ impl InMemorySchema {
365365
self.enums.iter()
366366
}
367367

368+
pub fn get_enums_par_iter(&self) -> impl ParallelIterator<Item = &Enum> {
369+
self.enums.par_iter()
370+
}
371+
368372
pub fn get_objects(&self) -> impl Iterator<Item = &Object> {
369373
self.objects.iter()
370374
}

compiler/crates/schema/src/schema.rs

+7
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,13 @@ impl SDLSchema {
389389
}
390390
}
391391

392+
pub fn get_enums_par_iter(&self) -> impl ParallelIterator<Item = &Enum> {
393+
match self {
394+
SDLSchema::FlatBuffer(_schema) => todo!(),
395+
SDLSchema::InMemory(schema) => schema.get_enums_par_iter(),
396+
}
397+
}
398+
392399
pub fn get_objects(&self) -> impl Iterator<Item = &Object> {
393400
match self {
394401
SDLSchema::FlatBuffer(_schema) => todo!(),

0 commit comments

Comments
 (0)