@@ -442,9 +442,14 @@ impl<S: Symbol> Wildtype<S> {
442
442
pub fn new ( sequence : Vec < S > ) -> HaplotypeRef < S > {
443
443
HaplotypeRef :: new_cyclic ( |reference| {
444
444
Haplotype :: Wildtype ( Self {
445
+ // head
445
446
reference : reference. clone ( ) ,
446
- sequence : sequence. clone ( ) ,
447
447
descendants : DescendantsCell :: new ( ) ,
448
+
449
+ // body
450
+ sequence : sequence. clone ( ) ,
451
+
452
+ // sync
448
453
_dirty_descendants : AtomicIsize :: new ( 0 ) ,
449
454
} )
450
455
} )
@@ -487,13 +492,18 @@ impl<S: Symbol> Mutant<S> {
487
492
) -> HaplotypeRef < S > {
488
493
HaplotypeRef :: new_cyclic ( |reference| {
489
494
Haplotype :: Mutant ( Self {
495
+ // head
490
496
reference : reference. clone ( ) ,
491
497
wildtype : wildtype. clone ( ) ,
492
498
ancestor : ancestor. clone ( ) ,
499
+ descendants : DescendantsCell :: new ( ) ,
500
+
501
+ // body
493
502
changes,
494
503
generation,
495
504
fitness : make_fitness_cache ( ) ,
496
- descendants : DescendantsCell :: new ( ) ,
505
+
506
+ // sync
497
507
_dirty_descendants : AtomicIsize :: new ( 0 ) ,
498
508
_defer_drop : Arc :: new ( Mutex :: new ( 0 ) ) ,
499
509
_drop : Cell :: new ( None ) ,
@@ -525,13 +535,18 @@ impl<S: Symbol> Mutant<S> {
525
535
526
536
// create new node
527
537
let tmp_ref = HaplotypeRef :: new ( Haplotype :: Mutant ( Self {
538
+ // head
528
539
reference : last. reference . clone ( ) ,
529
540
wildtype,
530
541
ancestor,
542
+ descendants : DescendantsCell :: from_iter ( descendants) ,
543
+
544
+ // body
531
545
changes,
532
546
generation,
533
547
fitness : make_fitness_cache ( ) ,
534
- descendants : DescendantsCell :: from_iter ( descendants) ,
548
+
549
+ // sync
535
550
_dirty_descendants : AtomicIsize :: new ( 0 ) ,
536
551
_defer_drop : last. _defer_drop . clone ( ) ,
537
552
_drop : Cell :: new ( None ) ,
@@ -736,15 +751,20 @@ impl<S: Symbol> Recombinant<S> {
736
751
) -> HaplotypeRef < S > {
737
752
HaplotypeRef :: new_cyclic ( |reference| {
738
753
Haplotype :: Recombinant ( Self {
754
+ // head
739
755
reference : reference. clone ( ) ,
740
756
wildtype : wildtype. get_weak ( ) ,
741
757
left_ancestor : left_ancestor. clone ( ) ,
742
758
right_ancestor : right_ancestor. clone ( ) ,
759
+ descendants : DescendantsCell :: new ( ) ,
760
+
761
+ // body
743
762
left_position,
744
763
right_position,
745
764
generation,
746
765
fitness : make_fitness_cache ( ) ,
747
- descendants : DescendantsCell :: new ( ) ,
766
+
767
+ // sync
748
768
_dirty_descendants : AtomicIsize :: new ( 0 ) ,
749
769
} )
750
770
} )
0 commit comments