diff options
| author | Mårten Nordheim <marten.nordheim@qt.io> | 2024-08-23 16:19:49 +0200 |
|---|---|---|
| committer | Mårten Nordheim <marten.nordheim@qt.io> | 2024-08-31 12:04:46 +0200 |
| commit | 5ae84d0afbd3690a2c003d06d920566a5d56dc8c (patch) | |
| tree | 97ec841349ca5a5dd3ea9ef01e299d5420d6bafb | |
| parent | de609d84b9cee4a481d1718c00b09105d8c2ae69 (diff) | |
QDecompressHelper: Use Q_UNLIKELY_BRANCH
Change-Id: I65a2af45fe3bc40c9b187715f538ebf56c0d4f99
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| -rw-r--r-- | src/network/access/qdecompresshelper.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/network/access/qdecompresshelper.cpp b/src/network/access/qdecompresshelper.cpp index 52a0d9fc061..ea19201fec2 100644 --- a/src/network/access/qdecompresshelper.cpp +++ b/src/network/access/qdecompresshelper.cpp @@ -584,7 +584,7 @@ qsizetype QDecompressHelper::readZLib(char *data, const qsizetype maxSize) // also an error. // in the case where we get Z_DATA_ERROR this could be because we received raw deflate // compressed data. - if (ret == Z_DATA_ERROR && !triedRawDeflate) { + if (ret == Z_DATA_ERROR && !triedRawDeflate) Q_UNLIKELY_BRANCH { inflateEnd(inflateStream); triedRawDeflate = true; inflateStream->zalloc = Z_NULL; @@ -708,6 +708,7 @@ qsizetype QDecompressHelper::readBrotli(char *data, const qsizetype maxSize) bytesDecoded += previousUnusedDecodedSize - unusedDecodedSize; switch (result) { + Q_UNLIKELY_BRANCH case BROTLI_DECODER_RESULT_ERROR: errorStr = QLatin1String("Brotli error: %1") .arg(QString::fromUtf8(BrotliDecoderErrorString( @@ -756,7 +757,7 @@ qsizetype QDecompressHelper::readZstandard(char *data, const qsizetype maxSize) qsizetype bytesDecoded = 0; while (outBuf.pos < outBuf.size && (inBuf.pos < inBuf.size || decoderHasData)) { size_t retValue = ZSTD_decompressStream(zstdStream, &outBuf, &inBuf); - if (ZSTD_isError(retValue)) { + if (ZSTD_isError(retValue)) Q_UNLIKELY_BRANCH { errorStr = QLatin1String("ZStandard error: %1") .arg(QString::fromUtf8(ZSTD_getErrorName(retValue))); return -1; |
