зеркало из https://github.com/dotnet/razor.git
Use abs just in case
This commit is contained in:
Родитель
0e6b9bbdfe
Коммит
33e4b984f5
|
@ -1,6 +1,7 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
||||
namespace Microsoft.VisualStudio.LanguageServices.Razor.Logging;
|
||||
|
@ -19,7 +20,7 @@ internal partial class MemoryLoggerProvider
|
|||
|
||||
public void Append(string s)
|
||||
{
|
||||
var position = Interlocked.Increment(ref _head) % _memory.Length;
|
||||
var position = Math.Abs(Interlocked.Increment(ref _head) % _memory.Length);
|
||||
_memory[position] = s;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче