Skip to content

Commit

Permalink
Remove useless checks
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierHecart committed May 3, 2024
1 parent b43b159 commit 0eb4e98
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 22 deletions.
8 changes: 1 addition & 7 deletions zenoh/src/net/routing/hat/linkstate_peer/pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -891,13 +891,7 @@ impl HatPubSubTrait for HatCode {

for (sid, context) in &mres.session_ctxs {
if context.subs.is_some()
&& match tables.whatami {
WhatAmI::Router => context.face.whatami != WhatAmI::Router,
_ => {
source_type == WhatAmI::Client
|| context.face.whatami == WhatAmI::Client
}
}
&& (source_type == WhatAmI::Client || context.face.whatami == WhatAmI::Client)
{
route.entry(*sid).or_insert_with(|| {
let key_expr = Resource::get_best_key(expr.prefix, expr.suffix, *sid);
Expand Down
5 changes: 1 addition & 4 deletions zenoh/src/net/routing/hat/linkstate_peer/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -934,10 +934,7 @@ impl HatQueriesTrait for HatCode {
);

for (sid, context) in &mres.session_ctxs {
if match tables.whatami {
WhatAmI::Router => context.face.whatami != WhatAmI::Router,
_ => source_type == WhatAmI::Client || context.face.whatami == WhatAmI::Client,
} {
if source_type == WhatAmI::Client || context.face.whatami == WhatAmI::Client {
let key_expr = Resource::get_best_key(expr.prefix, expr.suffix, *sid);
if let Some(qabl_info) = context.qabl.as_ref() {
route.push(QueryTargetQabl {
Expand Down
8 changes: 1 addition & 7 deletions zenoh/src/net/routing/hat/p2p_peer/pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,13 +577,7 @@ impl HatPubSubTrait for HatCode {

for (sid, context) in &mres.session_ctxs {
if context.subs.is_some()
&& match tables.whatami {
WhatAmI::Router => context.face.whatami != WhatAmI::Router,
_ => {
source_type == WhatAmI::Client
|| context.face.whatami == WhatAmI::Client
}
}
&& (source_type == WhatAmI::Client || context.face.whatami == WhatAmI::Client)
{
route.entry(*sid).or_insert_with(|| {
let key_expr = Resource::get_best_key(expr.prefix, expr.suffix, *sid);
Expand Down
5 changes: 1 addition & 4 deletions zenoh/src/net/routing/hat/p2p_peer/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,10 +560,7 @@ impl HatQueriesTrait for HatCode {
let mres = mres.upgrade().unwrap();
let complete = DEFAULT_INCLUDER.includes(mres.expr().as_bytes(), key_expr.as_bytes());
for (sid, context) in &mres.session_ctxs {
if match tables.whatami {
WhatAmI::Router => context.face.whatami != WhatAmI::Router,
_ => source_type == WhatAmI::Client || context.face.whatami == WhatAmI::Client,
} {
if source_type == WhatAmI::Client || context.face.whatami == WhatAmI::Client {
let key_expr = Resource::get_best_key(expr.prefix, expr.suffix, *sid);
if let Some(qabl_info) = context.qabl.as_ref() {
route.push(QueryTargetQabl {
Expand Down

0 comments on commit 0eb4e98

Please sign in to comment.