Skip to content

Commit

Permalink
Optimize the path to compute role on Unix
Browse files Browse the repository at this point in the history
  • Loading branch information
DataTriny committed Dec 3, 2023
1 parent 17451d8 commit be1e9a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions consumer/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ impl NodeState {
self.data().role_description().map(String::from)
}

pub fn has_role_description(&self) -> bool {
self.data().role_description().is_some()
}

pub fn is_hidden(&self) -> bool {
self.data().is_hidden()
}
Expand Down
2 changes: 1 addition & 1 deletion platforms/unix/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl<'a> NodeWrapper<'a> {
}

pub fn role(&self) -> AtspiRole {
if self.node_state().role_description().is_some() {
if self.node_state().has_role_description() {
return AtspiRole::Extended;
}

Expand Down

0 comments on commit be1e9a9

Please sign in to comment.