File tree 3 files changed +16
-11
lines changed
Stryker.Core.UnitTest/Mutants
3 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -1953,11 +1953,13 @@ public void ShouldProtectDirectives()
1953
1953
}" ;
1954
1954
var expected = @"public void SomeMethod() {if(StrykerNamespace.MutantControl.IsActive(0)){}else{
1955
1955
var x = 0;
1956
- if(StrykerNamespace.MutantControl.IsActive(1)){;}else{if(StrykerNamespace.MutantControl.IsActive(2)){ #if !DEBUG
1956
+ #if !DEBUG
1957
+ if(StrykerNamespace.MutantControl.IsActive(1)){;}else{if(StrykerNamespace.MutantControl.IsActive(2)){
1957
1958
x--;
1958
- }else{ #if !DEBUG
1959
+ }else{
1959
1960
x++;
1960
- }} #endif
1961
+ }}
1962
+ #endif
1961
1963
}}" ;
1962
1964
1963
1965
ShouldMutateSourceInClassToExpected ( source , expected ) ;
Original file line number Diff line number Diff line change @@ -542,20 +542,20 @@ private static StringBuilder BuildReferenceChoice(IEnumerable<string> projectRef
542
542
543
543
private sealed class DynamicEnumerableQueue < T >
544
544
{
545
- private readonly Queue < T > _queue ;
546
- private readonly HashSet < T > _cache ;
545
+ private readonly ConcurrentQueue < T > _queue ;
546
+ private readonly ConcurrentDictionary < T , bool > _cache ;
547
547
548
548
public DynamicEnumerableQueue ( IEnumerable < T > init )
549
549
{
550
- _cache = [ .. init ] ;
551
- _queue = new Queue < T > ( _cache ) ;
550
+ _cache = new ( init . ToDictionary ( x => x , x => true ) ) ;
551
+ _queue = new ( _cache . Keys ) ;
552
552
}
553
553
554
- public bool Empty => _queue . Count == 0 ;
554
+ public bool Empty => _queue . IsEmpty ;
555
555
556
556
public void Add ( T entry )
557
557
{
558
- if ( ! _cache . Add ( entry ) )
558
+ if ( ! _cache . TryAdd ( entry , true ) )
559
559
{
560
560
return ;
561
561
}
@@ -566,7 +566,10 @@ public IEnumerable<T> Consume()
566
566
{
567
567
while ( _queue . Count > 0 )
568
568
{
569
- yield return _queue . Dequeue ( ) ;
569
+ if ( _queue . TryDequeue ( out var entry ) )
570
+ {
571
+ yield return entry ;
572
+ }
570
573
}
571
574
}
572
575
}
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ private static List<INodeOrchestrator> BuildOrchestratorList() =>
62
62
new MemberAccessExpressionOrchestrator < SimpleNameSyntax > ( ) ,
63
63
new MemberAccessExpressionOrchestrator < PostfixUnaryExpressionSyntax > ( t =>
64
64
t . IsKind ( SyntaxKind . SuppressNullableWarningExpression ) ) ,
65
- // ensure patterhsyntax nodes are mutated (as they are neither expression nor statements, they are not mutated by default)
65
+ // ensure pattern syntax nodes are mutated (as they are neither expression nor statements, they are not mutated by default)
66
66
new NodeSpecificOrchestrator < PatternSyntax , PatternSyntax > ( ) ,
67
67
new NodeSpecificOrchestrator < SubpatternSyntax , SubpatternSyntax > ( ) ,
68
68
new ConditionalExpressionOrchestrator ( ) ,
You can’t perform that action at this time.
0 commit comments