Proper use of range for

This commit is contained in:
Luis Ángel San Martín 2021-09-30 22:05:15 +02:00
parent c03b1075f3
commit c1d3fb0778
2 changed files with 3 additions and 3 deletions

View File

@ -27,7 +27,7 @@ QStringList Comic::getSupportedImageFormats()
{
QList<QByteArray> supportedImageFormats = QImageReader::supportedImageFormats();
QStringList supportedImageFormatStrings;
for (QByteArray item : supportedImageFormats) {
for (QByteArray &item : supportedImageFormats) {
supportedImageFormatStrings.append(QString::fromLocal8Bit("*." + item));
}
return supportedImageFormatStrings;
@ -37,7 +37,7 @@ QStringList Comic::getSupportedImageLiteralFormats()
{
QList<QByteArray> supportedImageFormats = QImageReader::supportedImageFormats();
QStringList supportedImageFormatStrings;
for (QByteArray item : supportedImageFormats) {
for (QByteArray &item : supportedImageFormats) {
supportedImageFormatStrings.append(QString::fromLocal8Bit(item));
}
return supportedImageFormatStrings;

View File

@ -1276,7 +1276,7 @@ YACReaderPageFlowGL::~YACReaderPageFlowGL()
makeCurrent();
for (auto image : images) {
for (auto &image : images) {
if (image.texture != defaultTexture) {
if (image.texture->isCreated()) {
image.texture->destroy();