Skip to content

Commit 890f0a8

Browse files
committed
refactor double capacity check
1 parent a01966d commit 890f0a8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Sep/SepReader.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,7 @@ bool EnsureInitializeAndReadData(bool endOfFile)
316316

317317
if (_parser != null && _charsParseStart < _charsDataEnd)
318318
{
319-
// + 1 - must be room for one more col always
320-
if ((_parsingRowColEndsOrInfosStartIndex + _parsingRowColCount + 1) >= (GetColInfosLength() - _parser.PaddingLength - ColEndsOrInfosExtraEndCount))
319+
if ((_parsingRowColEndsOrInfosStartIndex + _parsingRowColCount + ColEndsOrInfosExtraEndCount) >= (GetColInfosLength() - _parser.PaddingLength))
321320
{
322321
DoubleColInfosCapacityCopyState();
323322
}
@@ -326,8 +325,7 @@ bool EnsureInitializeAndReadData(bool endOfFile)
326325
{
327326
if (nothingLeftToRead)
328327
{
329-
// + 1 - must be room for one more col always
330-
if ((_parsingRowColEndsOrInfosStartIndex + _parsingRowColCount + 1) >= (GetColInfosLength() - ColEndsOrInfosExtraEndCount))
328+
if ((_parsingRowColEndsOrInfosStartIndex + _parsingRowColCount + ColEndsOrInfosExtraEndCount) >= (GetColInfosLength() - ColEndsOrInfosExtraEndCount))
331329
{
332330
DoubleColInfosCapacityCopyState();
333331
}

0 commit comments

Comments
 (0)