Improve logger performance.

This commit is contained in:
Christian Kratky
2020-05-12 21:55:15 +02:00
parent f0a1f9ca93
commit a58ab607ad
51 changed files with 290 additions and 300 deletions
@@ -11,14 +11,17 @@ namespace MQTTnet.Protocol
throw new MqttProtocolViolationException("Topic should not be empty.");
}
if (topic.Contains("+"))
foreach(var @char in topic)
{
throw new MqttProtocolViolationException("The character '+' is not allowed in topics.");
}
if (@char == '+')
{
throw new MqttProtocolViolationException("The character '+' is not allowed in topics.");
}
if (topic.Contains("#"))
{
throw new MqttProtocolViolationException("The character '#' is not allowed in topics.");
if (@char == '#')
{
throw new MqttProtocolViolationException("The character '#' is not allowed in topics.");
}
}
}
}