From c235a1e50210da88cf19e4ded3041325bbd610f2 Mon Sep 17 00:00:00 2001 From: Dieter Lunn Date: Tue, 2 Jul 2024 09:54:51 -0500 Subject: [PATCH] fix: changing iterator value in loop --- src/Ubiety.Stringprep.Core/Ubiety.Stringprep.Core.csproj | 9 +++------ src/Ubiety.Stringprep.Core/ValueRangeCompiler.cs | 8 ++++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/Ubiety.Stringprep.Core/Ubiety.Stringprep.Core.csproj b/src/Ubiety.Stringprep.Core/Ubiety.Stringprep.Core.csproj index 27db751..b124d03 100644 --- a/src/Ubiety.Stringprep.Core/Ubiety.Stringprep.Core.csproj +++ b/src/Ubiety.Stringprep.Core/Ubiety.Stringprep.Core.csproj @@ -5,8 +5,9 @@ net8.0 default latest + Ubiety.Stringprep.Core.xml - + icon128.png Stringprep library implementing RFC3454 @@ -16,15 +17,11 @@ https://github.com/ubiety/Ubiety.StringPrep.Core/ ubiety;stringprep;dotnet - + - - Ubiety.Stringprep.Core.xml - - all diff --git a/src/Ubiety.Stringprep.Core/ValueRangeCompiler.cs b/src/Ubiety.Stringprep.Core/ValueRangeCompiler.cs index 78313b6..ed508d9 100644 --- a/src/Ubiety.Stringprep.Core/ValueRangeCompiler.cs +++ b/src/Ubiety.Stringprep.Core/ValueRangeCompiler.cs @@ -186,13 +186,13 @@ private static List DoRemove(List list, IList removals) { if (removals[i] == list[j] || (removals[i] < list[j] && (i == 0 || removals[i] > list[j - 1]))) { - list.RemoveAt(j--); - CloseRemove(list, removals, ref i, ref j); + list.RemoveAt(j - 1); + CloseRemove(list, removals, ref i, ref j - 1); } else if (removals[i] > list[j] && removals[i] < list[j + 1]) { - list.Insert(++j, removals[i] - 1); - CloseRemove(list, removals, ref i, ref j); + list.Insert(j + 1, removals[i] - 1); + CloseRemove(list, removals, ref i, ref j + 1); } } }