The following code seems redundant

This commit is contained in:
ayush
2023-09-12 16:21:51 +05:30
parent 67951ff2e9
commit fdf00ee917

View File

@@ -189,14 +189,8 @@ export class ServerMqtt extends Server implements CustomTransportStrategy {
if (this.messageHandlers.has(route)) {
return this.messageHandlers.get(route) || null;
}
for (const [key, value] of this.messageHandlers) {
if (
!key.includes(MQTT_WILDCARD_SINGLE) &&
!key.includes(MQTT_WILDCARD_ALL)
) {
continue;
}
const keyWithoutSharedPrefix = this.removeHandlerKeySharedPrefix(key);
if (this.matchMqttPattern(keyWithoutSharedPrefix, route)) {
return value;