optimization (don't call writer with 0 bytes); bug 122221; r=akkana, sr=darin

This commit is contained in:
brade%netscape.com 2002-02-07 14:19:32 +00:00
parent 3c2d249bd8
commit 15e11e7082

View File

@ -458,9 +458,10 @@ nsStorageInputStream::ReadSegments(nsWriteSegmentFun writer, void * closure, PRU
PRUint32 available = mStorageStream->mLogicalLength - mLogicalCursor;
if (!available)
goto out;
mReadCursor = mStorageStream->mSegmentedBuffer->GetSegment(mSegmentNum++);
mSegmentEnd = mReadCursor + PR_MIN(mSegmentSize, available);
availableInSegment = mSegmentEnd - mReadCursor;
}
count = PR_MIN(availableInSegment, remainingCapacity);