Change size to capacity
parent
e52585a16c
commit
ca1e096ed5
|
@ -155,7 +155,7 @@ AI_FORCE_INLINE LineSplitter::LineSplitter(StreamReaderLE& stream, bool skip_emp
|
|||
mSkip_empty_lines(skip_empty_lines),
|
||||
mTrim(trim) {
|
||||
mCur.reserve(1024);
|
||||
mEnd = mCur.c_str() + mCur.size();
|
||||
mEnd = mCur.c_str() + mCur.capacity();
|
||||
operator++();
|
||||
mIdx = 0;
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ AI_FORCE_INLINE LineSplitter& LineSplitter::operator++() {
|
|||
|
||||
char s;
|
||||
mCur.clear();
|
||||
mEnd = mCur.c_str() + mCur.size();
|
||||
mEnd = mCur.c_str() + mCur.capacity();
|
||||
while (mStream.GetRemainingSize() && (s = mStream.GetI1(), 1)) {
|
||||
if (s == '\n' || s == '\r') {
|
||||
if (mSkip_empty_lines) {
|
||||
|
@ -195,7 +195,7 @@ AI_FORCE_INLINE LineSplitter& LineSplitter::operator++() {
|
|||
break;
|
||||
}
|
||||
mCur += s;
|
||||
mEnd = mCur.c_str() + mCur.size();
|
||||
mEnd = mCur.c_str() + mCur.capacity();
|
||||
}
|
||||
++mIdx;
|
||||
|
||||
|
|
Loading…
Reference in New Issue