mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 10:52:56 +00:00
use QT_BUFFSIZE as buffer size in QXmlStreamReaderPrivate::getChar_helper()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
9d3d23f8a0
commit
b9506a1a00
1 changed files with 3 additions and 5 deletions
|
@ -30,10 +30,9 @@
|
|||
#include "qstack.h"
|
||||
#include "qbuffer.h"
|
||||
#include "qcoreapplication.h"
|
||||
#include "qplatformdefs.h"
|
||||
#include "qxmlcommon_p.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#include "qxmlstream_p.h"
|
||||
|
@ -1335,7 +1334,6 @@ void QXmlStreamReaderPrivate::putReplacementInAttributeValue(const QString &s)
|
|||
|
||||
ushort QXmlStreamReaderPrivate::getChar_helper()
|
||||
{
|
||||
const int BUFFER_SIZE = 8192;
|
||||
characterOffset += readBufferPos;
|
||||
readBufferPos = 0;
|
||||
readBuffer.resize(0);
|
||||
|
@ -1344,8 +1342,8 @@ ushort QXmlStreamReaderPrivate::getChar_helper()
|
|||
#endif
|
||||
nbytesread = 0;
|
||||
if (device) {
|
||||
rawReadBuffer.resize(BUFFER_SIZE);
|
||||
int nbytesreadOrMinus1 = device->read(rawReadBuffer.data() + nbytesread, BUFFER_SIZE - nbytesread);
|
||||
rawReadBuffer.resize(QT_BUFFSIZE);
|
||||
int nbytesreadOrMinus1 = device->read(rawReadBuffer.data() + nbytesread, QT_BUFFSIZE - nbytesread);
|
||||
nbytesread += qMax(nbytesreadOrMinus1, 0);
|
||||
} else {
|
||||
if (nbytesread)
|
||||
|
|
Loading…
Add table
Reference in a new issue