mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
C#: Minor adjustment to limiting the number of extractor messages
This commit is contained in:
@@ -21,7 +21,6 @@ namespace Semmle.Extraction.CSharp.Entities
|
||||
|
||||
protected override void Populate(TextWriter trapFile)
|
||||
{
|
||||
// The below doesn't limit the extractor messages to the exact limit, but it's good enough.
|
||||
var key = diagnostic.Id;
|
||||
var messageCount = compilation.messageCounts.AddOrUpdate(key, 1, (_, c) => c + 1);
|
||||
if (messageCount > limit)
|
||||
|
||||
@@ -19,11 +19,10 @@ namespace Semmle.Extraction.Entities
|
||||
|
||||
protected override void Populate(TextWriter trapFile)
|
||||
{
|
||||
// The below doesn't limit the extractor messages to the exact limit, but it's good enough.
|
||||
Interlocked.Increment(ref messageCount);
|
||||
if (messageCount > limit)
|
||||
var val = Interlocked.Increment(ref messageCount);
|
||||
if (val > limit)
|
||||
{
|
||||
if (messageCount == limit + 1)
|
||||
if (val == limit + 1)
|
||||
{
|
||||
Context.ExtractionContext.Logger.LogWarning($"Stopped logging extractor messages after reaching {limit}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user