mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-19 19:13:11 +08:00
Improve logger performance.
This commit is contained in:
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user