Skip to content

Commit

Permalink
chore: Move guard acquisition inside logic check
Browse files Browse the repository at this point in the history
  • Loading branch information
qdot committed Jan 1, 2024
1 parent 53f5d41 commit 150dc19
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/winrtble/peripheral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,8 @@ impl Peripheral {
}
}
if let Ok(manufacturer_data) = advertisement.ManufacturerData() {
let mut manufacturer_data_guard = self.shared.latest_manufacturer_data.write().unwrap();

if manufacturer_data.Size().unwrap() > 0 {
let mut manufacturer_data_guard = self.shared.latest_manufacturer_data.write().unwrap();
*manufacturer_data_guard = manufacturer_data
.into_iter()
.map(|d| {
Expand Down

0 comments on commit 150dc19

Please sign in to comment.