From 141373076bea67bf8d2d9e6c70d1c1d08731229f Mon Sep 17 00:00:00 2001 From: Steve Palmerin Date: Thu, 4 Jan 2024 22:55:57 -0700 Subject: [PATCH] fix unresolved --- .../QRCodeOnboardingPayloadParser.kt | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/src/controller/java/src/matter/onboardingpayload/QRCodeOnboardingPayloadParser.kt b/src/controller/java/src/matter/onboardingpayload/QRCodeOnboardingPayloadParser.kt index b87ed5b247628f..310e452be9f1fb 100644 --- a/src/controller/java/src/matter/onboardingpayload/QRCodeOnboardingPayloadParser.kt +++ b/src/controller/java/src/matter/onboardingpayload/QRCodeOnboardingPayloadParser.kt @@ -98,28 +98,23 @@ class QRCodeOnboardingPayloadParser(private val mBase38Representation: String) { val info = OptionalQRCodeInfoExtension() // update tag - if (element.tag is ContextSpecificTag) { - element.tag.let { info.tag = it.tagNumber } + val tag = element.tag + if (tag is ContextSpecificTag) { + info.tag = tag.tagNumber } - + val value = element.value // update values - if (element.value is IntValue) { - element.value.let { - info.int32 = it.value.toInt() - info.type = OptionalQRCodeInfoType.TYPE_INT32 - } + if (value is IntValue) { + info.int32 = value.value.toInt() + info.type = OptionalQRCodeInfoType.TYPE_INT32 } - if (element.value is UnsignedIntValue) { - element.value.let { - info.uint32 = it.value - info.type = OptionalQRCodeInfoType.TYPE_UINT32 - } + if (value is UnsignedIntValue) { + info.uint32 = value.value + info.type = OptionalQRCodeInfoType.TYPE_UINT32 } - if (element.value is Utf8StringValue) { - element.value.let { - info.data = it.value - info.type = OptionalQRCodeInfoType.TYPE_STRING - } + if (value is Utf8StringValue) { + info.data = value.value + info.type = OptionalQRCodeInfoType.TYPE_STRING } if (info.tag < 0x80) {