summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-04-12 10:05:49 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-04-14 07:34:39 +0000
commit05bd791e299127a82aa99a7829a8fb63711e0218 (patch)
tree52b47d2bea177e326c22c9731900f25d8d7f42e7
parentb6a6f51ab7aa39224ade83c2e3f960979a3930cd (diff)
downloadqtconnectivity-6.2.tar.gz
DeviceDiscoveryBroadcastReceiver: reduce memory footprint of offset table6.2
Store ofsets in quint8, instead of int, saving 3 bytes per entry in TEXT size. Change-Id: I7aa48d6588fe67d8a428b3ec105919f482e1ffd5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 2023281c871f23256e8683687c640f44c1476a28) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/bluetooth/android/devicediscoverybroadcastreceiver.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bluetooth/android/devicediscoverybroadcastreceiver.cpp b/src/bluetooth/android/devicediscoverybroadcastreceiver.cpp
index 2875190f..cc7660e7 100644
--- a/src/bluetooth/android/devicediscoverybroadcastreceiver.cpp
+++ b/src/bluetooth/android/devicediscoverybroadcastreceiver.cpp
@@ -125,7 +125,7 @@ static constexpr MajorClassJavaToQtMapping majorMappings[] = {
// QBluetoothDeviceInfo::MajorDeviceClass value plus 1 matches index
// UncategorizedDevice shifts to index 0
-static const int minorIndexSizes[] = {
+static constexpr quint8 minorIndexSizes[] = {
64, // QBluetoothDevice::UncategorizedDevice
61, // QBluetoothDevice::MiscellaneousDevice
18, // QBluetoothDevice::ComputerDevice
@@ -351,7 +351,7 @@ void triggerCachingOfMinorsForMajor(QBluetoothDeviceInfo::MajorDeviceClass major
{
//qCDebug(QT_BT_ANDROID) << "Caching minor values for major" << major;
int mappingIndex = mappingIndexForMajor(major);
- int sizeIndex = minorIndexSizes[mappingIndex];
+ quint8 sizeIndex = minorIndexSizes[mappingIndex];
while (minorMappings[sizeIndex].javaFieldName != nullptr) {
jint fieldValue = QJniObject::getStaticField<jint>(