Skip to content

Commit e8edc5f

Browse files
committed
Refactor string comparisons to use single quotes
Updated `InlineQueryHandler.cs` and `TextMessageHandler.cs` to use single quotes for character comparisons in `StartsWith` and `EndsWith` method calls. This change improves code readability and consistency.
1 parent 124e192 commit e8edc5f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Sources/TelegramBot/Handlers/InlineQueryHandler.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,13 @@ public InlineQueryHandler(IReadOnlyCollection<MethodInfo> controllerMethods, Upd
4141
bool match = true;
4242
for (int i = 0; i < controllerCommandParts.Length; i++)
4343
{
44-
if (controllerCommandParts[i] != incomingCommandParts[i] && !controllerCommandParts[i].StartsWith("{") && !controllerCommandParts[i].EndsWith("}"))
44+
if (controllerCommandParts[i] != incomingCommandParts[i] && !controllerCommandParts[i].StartsWith('{')
45+
&& !controllerCommandParts[i].EndsWith('}'))
4546
{
4647
match = false;
4748
break;
4849
}
49-
if (controllerCommandParts[i].StartsWith("{") && controllerCommandParts[i].EndsWith("}"))
50+
if (controllerCommandParts[i].StartsWith('{') && controllerCommandParts[i].EndsWith('}'))
5051
{
5152
_args.Add(incomingCommandParts[i]);
5253
}

Sources/TelegramBot/Handlers/TextMessageHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public TextMessageHandler(IReadOnlyCollection<MethodInfo> controllerMethods, Upd
2626
var message = update.Message;
2727
var parts = message.Text!.Split(' ');
2828
string command = parts[0];
29-
if (!command.StartsWith("/"))
29+
if (!command.StartsWith('/'))
3030
{
3131
return null;
3232
}

0 commit comments

Comments
 (0)