@@ -485,7 +485,7 @@ public CircularBuffer(int capacity)
485
485
private int Capacity => _items . Length ;
486
486
487
487
/// <summary>
488
- /// Whether or not the buffer is at capacity.
488
+ /// Whether not the buffer is at capacity.
489
489
/// </summary>
490
490
public bool IsFull => Count == Capacity ;
491
491
@@ -676,7 +676,7 @@ private enum ContextState
676
676
// The context after the match.
677
677
private readonly List < string > _collectedPostContext ;
678
678
679
- // Current match info we are tracking postcontext for.
679
+ // Current match info we are tracking post-context for.
680
680
// At any given time, if set, this value will not be
681
681
// in the emitQueue but will be the next to be added.
682
682
private MatchInfo ? _matchInfo ;
@@ -730,7 +730,7 @@ public void TrackLine(string line)
730
730
public void TrackMatch ( MatchInfo match )
731
731
{
732
732
// Update the queue in case we were in the middle
733
- // of collecting postcontext for an older match...
733
+ // of collecting post-context for an older match...
734
734
if ( _contextState == ContextState . CollectPost )
735
735
{
736
736
UpdateQueue ( ) ;
@@ -756,8 +756,8 @@ public void TrackMatch(MatchInfo match)
756
756
// Track having reached the end of the file.
757
757
public void TrackEOF ( )
758
758
{
759
- // If we're in the middle of collecting postcontext , we
760
- // already have a match and it's okay to queue it up
759
+ // If we're in the middle of collecting post-context , we
760
+ // already have a match, and it's okay to queue it up
761
761
// early since there are no more lines to track context
762
762
// for.
763
763
if ( _contextState == ContextState . CollectPost )
@@ -832,7 +832,7 @@ private readonly struct ContextEntry
832
832
public override string ToString ( ) => _lineOrMatch as string ?? ( ( MatchInfo ) _lineOrMatch ) . Line ;
833
833
}
834
834
835
- // Whether or not early entries found
835
+ // Whether early entries found
836
836
// while still filling up the context buffer
837
837
// have been added to the emit queue.
838
838
// Used by UpdateQueue.
@@ -841,15 +841,15 @@ private readonly struct ContextEntry
841
841
private readonly int _preContext ;
842
842
private readonly int _postContext ;
843
843
844
- // A circular buffer tracking both precontext and postcontext .
844
+ // A circular buffer tracking both pre-context and post-context .
845
845
//
846
846
// Essentially, the buffer is separated into regions:
847
- // | prectxt region (older entries, length = precontext ) |
847
+ // | pre-context region (older entries, length = pre-context ) |
848
848
// | match region (length = 1) |
849
- // | postctxt region (newer entries, length = postcontext ) |
849
+ // | post-context region (newer entries, length = post-context ) |
850
850
//
851
851
// When context entries containing a match reach the "middle"
852
- // (the position between the pre/post context regions)
852
+ // (the position between the pre- /post- context regions)
853
853
// of this buffer, and the buffer is full, we will know
854
854
// enough context to populate the Context properties of the
855
855
// match. At that point, we will add the match object
@@ -892,14 +892,14 @@ public void TrackEOF()
892
892
{
893
893
// If the buffer is already full,
894
894
// check for any matches with incomplete
895
- // postcontext and add them to the emit queue.
895
+ // post-context and add them to the emit queue.
896
896
// These matches can be identified by being past
897
897
// the "middle" of the context buffer (still in
898
- // the postcontext region.
898
+ // the post-context region) .
899
899
//
900
900
// If the buffer isn't full, then nothing will have
901
901
// ever been emitted and everything is still waiting
902
- // on postcontext . So process the whole buffer.
902
+ // on post-context . So process the whole buffer.
903
903
int startIndex = _collectedContext . IsFull ? _preContext + 1 : 0 ;
904
904
EmitAllInRange ( startIndex , _collectedContext . Count - 1 ) ;
905
905
}
@@ -937,28 +937,28 @@ private void EmitAllInRange(int startIndex, int endIndex)
937
937
/// </summary>
938
938
private void UpdateQueue ( )
939
939
{
940
- // Are we at capacity and thus have enough postcontext ?
940
+ // Are we at capacity and thus have enough post-context ?
941
941
// Is there a match in the "middle" of the buffer
942
- // that we know the pre/post context for?
942
+ // that we know the pre- /post- context for?
943
943
//
944
944
// If this is the first time we've reached full capacity,
945
945
// hasProcessedPreEntries will not be set, and we
946
946
// should go through the entire context, because it might
947
947
// have entries that never collected enough
948
- // precontext . Otherwise, we should just look at the
948
+ // pre-context . Otherwise, we should just look at the
949
949
// middle region.
950
950
if ( _collectedContext . IsFull )
951
951
{
952
952
if ( _hasProcessedPreEntries )
953
953
{
954
954
// Only process a potential match with exactly
955
- // enough pre and post-context.
955
+ // enough pre- and post-context.
956
956
EmitAllInRange ( _preContext , _preContext ) ;
957
957
}
958
958
else
959
959
{
960
960
// Some of our early entries may not
961
- // have enough precontext . Process them too.
961
+ // have enough pre-context . Process them too.
962
962
EmitAllInRange ( 0 , _preContext ) ;
963
963
_hasProcessedPreEntries = true ;
964
964
}
@@ -1081,7 +1081,7 @@ private void UpdateQueue()
1081
1081
}
1082
1082
1083
1083
/// <summary>
1084
- /// ContextTracker that does not work for the case when pre- and post context is 0.
1084
+ /// ContextTracker that does not work for the case when pre- and post- context is 0.
1085
1085
/// </summary>
1086
1086
private sealed class NoContextTracker : IContextTracker
1087
1087
{
@@ -1251,7 +1251,7 @@ public string[]? LiteralPath
1251
1251
public SwitchParameter SimpleMatch { get ; set ; }
1252
1252
1253
1253
/// <summary>
1254
- /// Gets or sets a value indicating if the search is case sensitive.If true, then do case-sensitive searches.
1254
+ /// Gets or sets a value indicating if the search is case- sensitive.If true, then do case-sensitive searches.
1255
1255
/// </summary>
1256
1256
[ Parameter ]
1257
1257
public SwitchParameter CaseSensitive { get ; set ; }
@@ -1381,7 +1381,7 @@ public Encoding Encoding
1381
1381
/// Gets or sets the number of context lines to collect. If set to a
1382
1382
/// single integer value N, collects N lines each of pre-
1383
1383
/// and post- context. If set to a 2-tuple B,A, collects B
1384
- /// lines of pre- and A lines of post- context.
1384
+ /// lines of pre- and A lines of post-context.
1385
1385
/// If set to a list with more than 2 elements, the
1386
1386
/// excess elements are ignored.
1387
1387
/// </summary>
@@ -1419,7 +1419,7 @@ public Encoding Encoding
1419
1419
1420
1420
private int _postContext ;
1421
1421
1422
- // When we are in Raw mode or pre- and postcontext are zero, use the _noContextTracker, since we will not be needing trackedLines.
1422
+ // When we are in Raw mode or pre- and post-context are zero, use the _noContextTracker, since we will not be needing trackedLines.
1423
1423
private IContextTracker GetContextTracker ( ) => ( Raw || ( _preContext == 0 && _postContext == 0 ) )
1424
1424
? _noContextTracker
1425
1425
: new ContextTracker ( _preContext , _postContext ) ;
@@ -1607,7 +1607,7 @@ private bool ProcessFile(string filename)
1607
1607
// Read the file one line at a time...
1608
1608
try
1609
1609
{
1610
- // see if the file is one the include exclude list...
1610
+ // see if the file is one of the include exclude list...
1611
1611
if ( ! MeetsIncludeExcludeCriteria ( filename ) )
1612
1612
{
1613
1613
return false ;
@@ -1660,7 +1660,7 @@ private bool ProcessFile(string filename)
1660
1660
// Check for any remaining matches. This could be caused
1661
1661
// by breaking out of the loop early for quiet or list
1662
1662
// mode, or by reaching EOF before we collected all
1663
- // our postcontext .
1663
+ // our post-context .
1664
1664
contextTracker . TrackEOF ( ) ;
1665
1665
if ( FlushTrackerQueue ( contextTracker ) )
1666
1666
{
@@ -1966,8 +1966,8 @@ private static ErrorRecord BuildErrorRecord(string messageId, string arg0, strin
1966
1966
1967
1967
private static ErrorRecord BuildErrorRecord ( string messageId , object [ ] arguments , string errorId , Exception ? innerException )
1968
1968
{
1969
- string fmtedMsg = StringUtil . Format ( messageId , arguments ) ;
1970
- ArgumentException e = new ( fmtedMsg , innerException ) ;
1969
+ string formattedMessage = StringUtil . Format ( messageId , arguments ) ;
1970
+ ArgumentException e = new ( formattedMessage , innerException ) ;
1971
1971
return new ErrorRecord ( e , errorId , ErrorCategory . InvalidArgument , null ) ;
1972
1972
}
1973
1973
0 commit comments