Skip to content

Commit

Permalink
fix: lints
Browse files Browse the repository at this point in the history
  • Loading branch information
wyfo committed Nov 26, 2024
1 parent 52b04cd commit b88add3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions zenoh/src/api/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1972,6 +1972,11 @@ impl SessionInner {
#[cfg(feature = "unstable")] source_info: SourceInfo,
attachment: Option<ZBytes>,
) -> ZResult<()> {
if let Some(cache) = cache {
if cache.load(Ordering::Relaxed) != u64::MAX {
return Ok(());
}
}
const REMOTE_TAG: u64 = 0b01;
const LOCAL_TAG: u64 = 0b10;
const VERSION_SHIFT: u64 = 2;
Expand All @@ -1986,11 +1991,11 @@ impl SessionInner {
let mut to_cache = REMOTE_TAG | LOCAL_TAG;
if let Some(cache) = cache {
cached = cache.load(Ordering::Relaxed);
let version = cached >> 2;
let version = cached >> VERSION_SHIFT;
if version == state.subscription_version {
to_cache = cached;
} else {
to_cache = (state.subscription_version << 2) | 0b11;
to_cache = (state.subscription_version << VERSION_SHIFT) | REMOTE_TAG | LOCAL_TAG;
}
}
drop(state);
Expand Down

0 comments on commit b88add3

Please sign in to comment.