Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
helgoboss committed Nov 16, 2023
1 parent b0074b2 commit 9d09d99
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion main/src/domain/mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,8 @@ impl MainMapping {
self.tags.iter().any(|t| tags.contains(t))
}

// TODO-high-ms2 The source clone here will not be a complete clone since commit b0074b26!
// Don't clone the source!
pub fn qualified_source(&self) -> QualifiedSource {
QualifiedSource {
compartment: self.core.compartment,
Expand Down Expand Up @@ -396,7 +398,7 @@ impl MainMapping {
target_is_active: self.target_is_effectively_active(),
..self.core.options
},
..self.core.clone()
..self.core.splinter_real_time_core()
},
is_active: self.is_active_in_terms_of_activation_state(),
target_category: self.unresolved_target.as_ref().map(|t| match t {
Expand Down Expand Up @@ -1512,6 +1514,13 @@ pub struct MappingCore {
}

impl MappingCore {
pub fn splinter_real_time_core(&self) -> Self {
// This clone is special. Some compiled feedback scripts deep inside the object graph (in
// source and mode, in particular) will not really be cloned because the real-time
// processor will not use them anyway! Look up `CloneAsDefault`.
self.clone()
}

pub fn invocation_count(&self) -> u32 {
self.invocation_count
}
Expand Down

0 comments on commit 9d09d99

Please sign in to comment.