[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed and optimized split methods #11

Merged
Prev Previous commit
Next Next commit
RemoveEmptyEntries on CutLastElements too
  • Loading branch information
Guiorgy committed Feb 5, 2024
commit c41ff07fb6728a19bf36573b0760f93c049e9989
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public bool MoveNext()
{
EnumerationDone = true;

if(delimiterIndex != -1 && RemoveEmptyEntries && CountExceedingBehaviour == CountExceedingBehaviour.AppendLastElements) // skip all empty (after trimming if necessary) entries from the left
if(delimiterIndex != -1 && RemoveEmptyEntries) // skip all empty (after trimming if necessary) entries from the left
{
do
{
Expand All @@ -86,6 +86,10 @@ public bool MoveNext()
continue;
}

if(CountExceedingBehaviour == CountExceedingBehaviour.CutLastElements)
{
Span = beforeDelimiter;
}
break;
}
while(delimiterIndex != -1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public bool MoveNext()
{
EnumerationDone = true;

if(delimiterIndex != -1 && RemoveEmptyEntries && CountExceedingBehaviour == CountExceedingBehaviour.AppendLastElements) // skip all empty (after trimming if necessary) entries from the left
if(delimiterIndex != -1 && RemoveEmptyEntries) // skip all empty (after trimming if necessary) entries from the left
{
do
{
Expand All @@ -86,6 +86,10 @@ public bool MoveNext()
continue;
}

if(CountExceedingBehaviour == CountExceedingBehaviour.CutLastElements)
{
Span = beforeDelimiter;
}
break;
}
while(delimiterIndex != -1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public bool MoveNext()
{
EnumerationDone = true;

if(delimiterIndex != -1 && RemoveEmptyEntries && CountExceedingBehaviour == CountExceedingBehaviour.AppendLastElements) // skip all empty (after trimming if necessary) entries from the left
if(delimiterIndex != -1 && RemoveEmptyEntries) // skip all empty (after trimming if necessary) entries from the left
{
do
{
Expand All @@ -87,6 +87,10 @@ public bool MoveNext()
continue;
}

if(CountExceedingBehaviour == CountExceedingBehaviour.CutLastElements)
{
Span = beforeDelimiter;
}
break;
}
while(delimiterIndex != -1);
Expand Down