@@ -659,29 +659,6 @@ impl Dag {
659
659
}
660
660
}
661
661
662
- /// A [`SystemSet`] with metadata, stored in a [`ScheduleGraph`].
663
- struct SystemSetNode {
664
- inner : InternedSystemSet ,
665
- }
666
-
667
- impl SystemSetNode {
668
- pub fn new ( set : InternedSystemSet ) -> Self {
669
- Self { inner : set }
670
- }
671
-
672
- pub fn name ( & self ) -> String {
673
- format ! ( "{:?}" , & self . inner)
674
- }
675
-
676
- pub fn is_system_type ( & self ) -> bool {
677
- self . inner . system_type ( ) . is_some ( )
678
- }
679
-
680
- pub fn is_anonymous ( & self ) -> bool {
681
- self . inner . is_anonymous ( )
682
- }
683
- }
684
-
685
662
/// A [`SystemWithAccess`] stored in a [`ScheduleGraph`].
686
663
pub struct SystemNode {
687
664
inner : Option < SystemWithAccess > ,
@@ -785,7 +762,7 @@ enum UninitializedId {
785
762
#[ derive( Default ) ]
786
763
struct SystemSets {
787
764
/// List of system sets in the schedule
788
- sets : SlotMap < SystemSetKey , SystemSetNode > ,
765
+ sets : SlotMap < SystemSetKey , InternedSystemSet > ,
789
766
/// List of conditions for each system set, in the same order as `system_sets`
790
767
conditions : SecondaryMap < SystemSetKey , Vec < ConditionWithAccess > > ,
791
768
/// Map from system set to node id
@@ -795,7 +772,7 @@ struct SystemSets {
795
772
impl SystemSets {
796
773
fn get_or_add_set ( & mut self , set : InternedSystemSet ) -> SystemSetKey {
797
774
* self . ids . entry ( set) . or_insert_with ( || {
798
- let key = self . sets . insert ( SystemSetNode :: new ( set) ) ;
775
+ let key = self . sets . insert ( set) ;
799
776
self . conditions . insert ( key, Vec :: new ( ) ) ;
800
777
key
801
778
} )
@@ -875,7 +852,7 @@ impl ScheduleGraph {
875
852
876
853
/// Returns the set at the given [`NodeId`], if it exists.
877
854
pub fn get_set_at ( & self , key : SystemSetKey ) -> Option < & dyn SystemSet > {
878
- self . system_sets . sets . get ( key) . map ( |set| & * set. inner )
855
+ self . system_sets . sets . get ( key) . map ( |set| & * * set)
879
856
}
880
857
881
858
/// Returns the set at the given [`NodeId`].
@@ -917,10 +894,9 @@ impl ScheduleGraph {
917
894
pub fn system_sets (
918
895
& self ,
919
896
) -> impl Iterator < Item = ( SystemSetKey , & dyn SystemSet , & [ ConditionWithAccess ] ) > {
920
- self . system_sets . sets . iter ( ) . filter_map ( |( key, set_node) | {
921
- let set = & * set_node. inner ;
897
+ self . system_sets . sets . iter ( ) . filter_map ( |( key, set) | {
922
898
let conditions = self . system_sets . conditions . get ( key) ?. as_slice ( ) ;
923
- Some ( ( key, set, conditions) )
899
+ Some ( ( key, & * * set, conditions) )
924
900
} )
925
901
}
926
902
@@ -1704,7 +1680,7 @@ impl ScheduleGraph {
1704
1680
if set. is_anonymous ( ) {
1705
1681
self . anonymous_set_name ( id)
1706
1682
} else {
1707
- set . name ( )
1683
+ format ! ( "{set:?}" )
1708
1684
}
1709
1685
}
1710
1686
}
@@ -1927,7 +1903,7 @@ impl ScheduleGraph {
1927
1903
) -> Result < ( ) , ScheduleBuildError > {
1928
1904
for ( & key, systems) in set_systems {
1929
1905
let set = & self . system_sets . sets [ key] ;
1930
- if set. is_system_type ( ) {
1906
+ if set. system_type ( ) . is_some ( ) {
1931
1907
let instances = systems. len ( ) ;
1932
1908
let ambiguous_with = self . ambiguous_with . edges ( NodeId :: Set ( key) ) ;
1933
1909
let before = self
@@ -2033,7 +2009,7 @@ impl ScheduleGraph {
2033
2009
fn names_of_sets_containing_node ( & self , id : & NodeId ) -> Vec < String > {
2034
2010
let mut sets = <HashSet < _ > >:: default ( ) ;
2035
2011
self . traverse_sets_containing_node ( * id, & mut |key| {
2036
- ! self . system_sets . sets [ key] . is_system_type ( ) && sets. insert ( key)
2012
+ self . system_sets . sets [ key] . system_type ( ) . is_none ( ) && sets. insert ( key)
2037
2013
} ) ;
2038
2014
let mut sets: Vec < _ > = sets
2039
2015
. into_iter ( )
0 commit comments