8000 Fixing spelling in comments · powercode/PowerShell@22488d6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 22488d6

Browse files
committed
Fixing spelling in comments
1 parent ec9980f commit 22488d6

File tree

1 file changed

+26
-26
lines changed
  • src/Microsoft.PowerShell.Commands.Utility/commands/utility

1 file changed

+26
-26
lines changed

src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ public CircularBuffer(int capacity)
485485
private int Capacity => _items.Length;
486486

487487
/// <summary>
488-
/// Whether or not the buffer is at capacity.
488+
/// Whether not the buffer is at capacity.
489489
/// </summary>
490490
public bool IsFull => Count == Capacity;
491491

@@ -676,7 +676,7 @@ private enum ContextState
676676
// The context after the match.
677677
private readonly List<string> _collectedPostContext;
678678

679-
// Current match info we are tracking postcontext for.
679+
// Current match info we are tracking post-context for.
680680
// At any given time, if set, this value will not be
681681
// in the emitQueue but will be the next to be added.
682682
private MatchInfo? _matchInfo;
@@ -730,7 +730,7 @@ public void TrackLine(string line)
730730
public void TrackMatch(MatchInfo match)
731731
{
732732
// 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...
734734
if (_contextState == ContextState.CollectPost)
735735
{
736736
UpdateQueue();
@@ -756,8 +756,8 @@ public void TrackMatch(MatchInfo match)
756756
// Track having reached the end of the file.
757757
public void TrackEOF()
758758
{
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
761761
// early since there are no more lines to track context
762762
// for.
763763
if (_contextState == ContextState.CollectPost)
@@ -832,7 +832,7 @@ private readonly struct ContextEntry
832832
public override string ToString() => _lineOrMatch as string ?? ((MatchInfo)_lineOrMatch).Line;
833833
}
834834

835-
// Whether or not early entries found
835+
// Whether early entries found
836836
// while still filling up the context buffer
837837
// have been added to the emit queue.
838838
// Used by UpdateQueue.
@@ -841,15 +841,15 @@ private readonly struct ContextEntry
841841
private readonly int _preContext;
842842
private readonly int _postContext;
843843

844-
// A circular buffer tracking both precontext and postcontext.
844+
// A circular buffer tracking both pre-context and post-context.
845845
//
846846
// Essentially, the buffer is separated into regions:
847-
// | prectxt region (older entries, length = precontext) |
847+
// | pre-context region (older entries, length = pre-context) |
848848
// | match region (length = 1) |
849-
// | postctxt region (newer entries, length = postcontext) |
849+
// | post-context region (newer entries, length = post-context) |
850850
//
851851
// 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)
853853
// of this buffer, and the buffer is full, we will know
854854
// enough context to populate the Context properties of the
855855
// match. At that point, we will add the match object
@@ -892,14 +892,14 @@ public void TrackEOF()
892892
{
893893
// If the buffer is already full,
894894
// 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.
896896
// These matches can be identified by being past
897897
// the "middle" of the context buffer (still in
898-
// the postcontext region.
898+
// the post-context region).
899899
//
900900
// If the buffer isn't full, then nothing will have
901901
// 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.
903903
int startIndex = _collectedContext.IsFull ? _preContext + 1 : 0;
904904
EmitAllInRange(startIndex, _collectedContext.Count - 1);
905905
}
@@ -937,28 +937,28 @@ private void EmitAllInRange(int startIndex, int endIndex)
937937
/// </summary>
938938
private void UpdateQueue()
939939
{
940-
// Are we at capacity and thus have enough postcontext?
940+
// Are we at capacity and thus have enough post-context?
941941
// 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?
943943
//
944944
// If this is the first time we've reached full capacity,
945945
// hasProcessedPreEntries will not be set, and we
946946
// should go through the entire context, because it might
947947
// 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
949949
// middle region.
950950
if (_collectedContext.IsFull)
951951
{
952952
if (_hasProcessedPreEntries)
953953
{
954954
// Only process a potential match with exactly
955-
// enough pre and post-context.
955+
// enough pre- and post-context.
956956
EmitAllInRange(_preContext, _preContext);
957957
}
958958
else
959959
{
960960
// Some of our early entries may not
961-
// have enough precontext. Process them too.
961+
// have enough pre-context. Process them too.
962962
EmitAllInRange(0, _preContext);
963963
_hasProcessedPreEntries = true;
964964
}
@@ -1081,7 +1081,7 @@ private void UpdateQueue()
10811081
}
10821082

10831083
/// <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.
10851085
/// </summary>
10861086
private sealed class NoContextTracker : IContextTracker
10871087
{
@@ -1251,7 +1251,7 @@ public string[]? LiteralPath
12511251
public SwitchParameter SimpleMatch { get; set; }
12521252

12531253
/// <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.
12551255
/// </summary>
12561256
[Parameter]
12571257
public SwitchParameter CaseSensitive { get; set; }
@@ -1381,7 +1381,7 @@ public Encoding Encoding
13811381
/// Gets or sets the number of context lines to collect. If set to a
13821382
/// single integer value N, collects N lines each of pre-
13831383
/// 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.
13851385
/// If set to a list with more than 2 elements, the
13861386
/// excess elements are ignored.
13871387
/// </summary>
@@ -1419,7 +1419,7 @@ public Encoding Encoding
14191419

14201420
private int _postContext;
14211421

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.
14231423
private IContextTracker GetContextTracker() => (Raw || (_preContext == 0 && _postContext == 0))
14241424
? _noContextTracker
14251425
: new ContextTracker(_preContext, _postContext);
@@ -1607,7 +1607,7 @@ private bool ProcessFile(string filename)
16071607
// Read the file one line at a time...
16081608
try
16091609
{
1610-
// see if the file is one the include exclude list...
1610+
// see if the file is one of the include exclude list...
16111611
if (!MeetsIncludeExcludeCriteria(filename))
16121612
{
16131613
return false;
@@ -1660,7 +1660,7 @@ private bool ProcessFile(string filename)
16601660
// Check for any remaining matches. This could be caused
16611661
// by breaking out of the loop early for quiet or list
16621662
// mode, or by reaching EOF before we collected all
1663-
// our postcontext.
1663+
// our post-context.
16641664
contextTracker.TrackEOF();
16651665
if (FlushTrackerQueue(contextTracker))
16661666
{
@@ -1966,8 +1966,8 @@ private static ErrorRecord BuildErrorRecord(string messageId, string arg0, strin
19661966

19671967
private static ErrorRecord BuildErrorRecord(string messageId, object[] arguments, string errorId, Exception? innerException)
19681968
{
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);
19711971
return new ErrorRecord(e, errorId, ErrorCategory.InvalidArgument, null);
19721972
}
19731973

0 commit comments

Comments
 (0)
0