From ec0ba49dba713d86ebc433ce90cccbb46db00b9d Mon Sep 17 00:00:00 2001 From: Tine <92650477+TineTheUnc@users.noreply.github.com> Date: Mon, 1 Jul 2024 00:09:03 +0700 Subject: [PATCH] Fix IndexOf bug in CreateBucketId (#2948) Fix IndexOf bug in CreateBucketId --- src/Discord.Net.Rest/DiscordRestApiClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Discord.Net.Rest/DiscordRestApiClient.cs b/src/Discord.Net.Rest/DiscordRestApiClient.cs index 05ec5fdc3f..e73a8e70f3 100644 --- a/src/Discord.Net.Rest/DiscordRestApiClient.cs +++ b/src/Discord.Net.Rest/DiscordRestApiClient.cs @@ -2705,14 +2705,14 @@ private static Func CreateBucketId(Expression> int lastIndex = 0; while (true) { - int leftIndex = format.IndexOf("{", lastIndex); + int leftIndex = format.IndexOf('{', lastIndex); if (leftIndex == -1 || leftIndex > endIndex) { builder.Append(format, lastIndex, endIndex - lastIndex); break; } builder.Append(format, lastIndex, leftIndex - lastIndex); - int rightIndex = format.IndexOf("}", leftIndex); + int rightIndex = format.IndexOf('}', leftIndex); int argId = int.Parse(format.Substring(leftIndex + 1, rightIndex - leftIndex - 1), NumberStyles.None, CultureInfo.InvariantCulture); string fieldName = GetFieldName(methodArgs[argId + 1]);