From 4d41a171d6e2a5a73846c3d8024b8528cefc2f26 Mon Sep 17 00:00:00 2001 From: Pierre Avital Date: Tue, 23 Jan 2024 12:28:58 +0100 Subject: [PATCH] make intersect try to consume superwilds ASAP --- src/protocol/keyexpr.c | 12 ++++++------ zenohpico.pc | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/protocol/keyexpr.c b/src/protocol/keyexpr.c index 28910e29e..4f1b10a60 100644 --- a/src/protocol/keyexpr.c +++ b/src/protocol/keyexpr.c @@ -606,16 +606,16 @@ _Bool _z_keyexpr_intersect_bothsuper(_z_str_se_t l, _z_str_se_t r, _z_ke_chunk_m if (advanced1.start == NULL) { return !_z_keyexpr_has_verbatim(it2.s); } - return (current2.start[0] != _Z_VERBATIM && - _z_keyexpr_intersect_bothsuper(it1.s, advanced2, chunk_intersector)) || - _z_keyexpr_intersect_bothsuper(advanced1, it2.s, chunk_intersector); + return _z_keyexpr_intersect_bothsuper(advanced1, it2.s, chunk_intersector) || + (current2.start[0] != _Z_VERBATIM && + _z_keyexpr_intersect_bothsuper(it1.s, advanced2, chunk_intersector)); } else if (_z_keyexpr_is_superwild_chunk(current2)) { if (advanced2.start == NULL) { return !_z_keyexpr_has_verbatim(it1.s); } - return (current1.start[0] != _Z_VERBATIM && - _z_keyexpr_intersect_bothsuper(it2.s, advanced1, chunk_intersector)) || - _z_keyexpr_intersect_bothsuper(advanced2, it1.s, chunk_intersector); + return _z_keyexpr_intersect_bothsuper(advanced2, it1.s, chunk_intersector) || + (current1.start[0] != _Z_VERBATIM && + _z_keyexpr_intersect_bothsuper(it2.s, advanced1, chunk_intersector)); } else if (chunk_intersector(current1, current2)) { it1.s = advanced1; it2.s = advanced2; diff --git a/zenohpico.pc b/zenohpico.pc index ae9a01519..915f9cc6e 100644 --- a/zenohpico.pc +++ b/zenohpico.pc @@ -3,6 +3,6 @@ prefix=/usr/local Name: zenohpico Description: URL: -Version: 0.11.20240122dev +Version: 0.11.20240123dev Cflags: -I${prefix}/include Libs: -L${prefix}/lib -lzenohpico