Skip to content

Commit

Permalink
Fixed offset by one in AspNetRequestDurationLayoutRenderer (#836)
Browse files Browse the repository at this point in the history
  • Loading branch information
snakefoot authored Jul 29, 2022
1 parent bcdfce5 commit 499850e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private void RenderDurationMs(StringBuilder builder, double durationMs)
if (ReferenceEquals(Culture, CultureInfo.InvariantCulture))
{
var truncateMs = (long)durationMs;
if (DurationMsFormat != null && truncateMs >= 0 && truncateMs <= DurationMsFormat.Length)
if (DurationMsFormat != null && truncateMs >= 0 && truncateMs < DurationMsFormat.Length)
{
builder.Append(DurationMsFormat[truncateMs]);
}
Expand All @@ -114,7 +114,7 @@ private void RenderDurationMs(StringBuilder builder, double durationMs)
if (preciseMs < 10)
builder.Append('0');

if (DurationMsFormat != null && preciseMs <= DurationMsFormat.Length)
if (DurationMsFormat != null && preciseMs < DurationMsFormat.Length)
{
builder.Append(DurationMsFormat[preciseMs]);
}
Expand Down

0 comments on commit 499850e

Please sign in to comment.