diff --git a/src/Ramstack.Parsing/Parser.Repeat.cs b/src/Ramstack.Parsing/Parser.Repeat.cs index 513beee..f5a322a 100644 --- a/src/Ramstack.Parsing/Parser.Repeat.cs +++ b/src/Ramstack.Parsing/Parser.Repeat.cs @@ -471,7 +471,7 @@ public override bool TryParse(ref ParseContext context, [NotNullWhen(true)] out // In other words, the check would happen anyway, but by placing it here explicitly, // we eliminate the need for exception code inside Slice itself. // - // Even though logically (uint)index < (uint)s.Length implies (uint)index <= (uint)s.Length, + // Even though logically (uint)index < (uint)s.Length implies (uint)index + 1 <= (uint)s.Length, // the JIT cannot currently prove this identity and therefore cannot optimize away // the redundant check in Slice. @@ -563,7 +563,7 @@ public override bool TryParse(ref ParseContext context, out Unit value) // In other words, the check would happen anyway, but by placing it here explicitly, // we eliminate the need for exception code inside Slice itself. // - // Even though logically (uint)index < (uint)s.Length implies (uint)index <= (uint)s.Length, + // Even though logically (uint)index < (uint)s.Length implies (uint)index + 1 <= (uint)s.Length, // the JIT cannot currently prove this identity and therefore cannot optimize away // the redundant check in Slice.