diff options
author | Albert Astals Cid <albert.astals.cid@kdab.com> | 2019-10-03 17:08:13 +0200 |
---|---|---|
committer | Albert Astals Cid <albert.astals.cid@kdab.com> | 2019-10-04 09:00:24 +0200 |
commit | 3afe4a402c18a0956cab31169d843018d1b7a6d3 (patch) | |
tree | 38098dfcb971a937fc1ae4d1a948d3825238ec49 /src/platformsupport/edid/qedidparser.cpp | |
parent | 74a33df026cdcf6d4c352a931c2d9ccf6c85c04d (diff) |
Convert a few sizeof(array)/sizeof(element0) fors to range fors
Increases readability
Change-Id: I81ea915517fd2cd6bc2780f37ba8d8097c63f44b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/platformsupport/edid/qedidparser.cpp')
-rw-r--r-- | src/platformsupport/edid/qedidparser.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/platformsupport/edid/qedidparser.cpp b/src/platformsupport/edid/qedidparser.cpp index 06c8852825..6bf1f1db96 100644 --- a/src/platformsupport/edid/qedidparser.cpp +++ b/src/platformsupport/edid/qedidparser.cpp @@ -42,8 +42,6 @@ #include "qedidparser_p.h" #include "qedidvendortable_p.h" -#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0]) - #define EDID_DESCRIPTOR_ALPHANUMERIC_STRING 0xfe #define EDID_DESCRIPTOR_PRODUCT_NAME 0xfc #define EDID_DESCRIPTOR_SERIAL_NUMBER 0xff @@ -139,9 +137,9 @@ bool QEdidParser::parse(const QByteArray &blob) manufacturer = m_vendorCache.value(pnpIdString); if (manufacturer.isEmpty()) { // Find the manufacturer from the vendor lookup table - for (size_t i = 0; i < ARRAY_LENGTH(q_edidVendorTable); i++) { - if (strncmp(q_edidVendorTable[i].id, pnpId, 3) == 0) { - manufacturer = QString::fromUtf8(q_edidVendorTable[i].name); + for (const auto &vendor : q_edidVendorTable) { + if (strncmp(vendor.id, pnpId, 3) == 0) { + manufacturer = QString::fromUtf8(vendor.name); break; } } |