@@ -137,19 +137,17 @@ CHIP_ERROR Instance::ReadSupportedLocations(AttributeValueEncoder & aEncoder)
137
137
{
138
138
return aEncoder.EncodeNull ();
139
139
}
140
- else
141
- {
142
- return aEncoder.EncodeList ([this ](const auto & encoder) -> CHIP_ERROR {
143
- uint8_t locationIndex = 0 ;
144
- LocationStructureWrapper supportedLocation;
145
140
146
- while (mDelegate ->GetSupportedLocationByIndex (locationIndex++, supportedLocation))
147
- {
148
- ReturnErrorOnFailure (encoder.Encode (supportedLocation));
149
- }
150
- return CHIP_NO_ERROR;
151
- });
152
- }
141
+ return aEncoder.EncodeList ([this ](const auto & encoder) -> CHIP_ERROR {
142
+ uint8_t locationIndex = 0 ;
143
+ LocationStructureWrapper supportedLocation;
144
+
145
+ while (mDelegate ->GetSupportedLocationByIndex (locationIndex++, supportedLocation))
146
+ {
147
+ ReturnErrorOnFailure (encoder.Encode (supportedLocation));
148
+ }
149
+ return CHIP_NO_ERROR;
150
+ });
153
151
}
154
152
155
153
CHIP_ERROR Instance::ReadSupportedMaps (AttributeValueEncoder & aEncoder)
@@ -158,19 +156,17 @@ CHIP_ERROR Instance::ReadSupportedMaps(AttributeValueEncoder & aEncoder)
158
156
{
159
157
return aEncoder.EncodeNull ();
160
158
}
161
- else
162
- {
163
- return aEncoder.EncodeList ([this ](const auto & encoder) -> CHIP_ERROR {
164
- uint32_t mapIndex = 0 ;
165
- MapStructureWrapper supportedMap;
166
159
167
- while (mDelegate ->GetSupportedMapByIndex (mapIndex++, supportedMap))
168
- {
169
- ReturnErrorOnFailure (encoder.Encode (supportedMap));
170
- }
171
- return CHIP_NO_ERROR;
172
- });
173
- }
160
+ return aEncoder.EncodeList ([this ](const auto & encoder) -> CHIP_ERROR {
161
+ uint32_t mapIndex = 0 ;
162
+ MapStructureWrapper supportedMap;
163
+
164
+ while (mDelegate ->GetSupportedMapByIndex (mapIndex++, supportedMap))
165
+ {
166
+ ReturnErrorOnFailure (encoder.Encode (supportedMap));
167
+ }
168
+ return CHIP_NO_ERROR;
169
+ });
174
170
}
175
171
176
172
CHIP_ERROR Instance::ReadSelectedLocations (AttributeValueEncoder & aEncoder)
@@ -179,19 +175,17 @@ CHIP_ERROR Instance::ReadSelectedLocations(AttributeValueEncoder & aEncoder)
179
175
{
180
176
return aEncoder.EncodeNull ();
181
177
}
182
- else
183
- {
184
- return aEncoder.EncodeList ([this ](const auto & encoder) -> CHIP_ERROR {
185
- uint32_t locationIndex = 0 ;
186
- uint32_t selectedLocation;
187
178
188
- while (mDelegate ->GetSelectedLocationByIndex (locationIndex++, selectedLocation))
189
- {
190
- ReturnErrorOnFailure (encoder.Encode (selectedLocation));
191
- }
192
- return CHIP_NO_ERROR;
193
- });
194
- }
179
+ return aEncoder.EncodeList ([this ](const auto & encoder) -> CHIP_ERROR {
180
+ uint32_t locationIndex = 0 ;
181
+ uint32_t selectedLocation;
182
+
183
+ while (mDelegate ->GetSelectedLocationByIndex (locationIndex++, selectedLocation))
184
+ {
185
+ ReturnErrorOnFailure (encoder.Encode (selectedLocation));
186
+ }
187
+ return CHIP_NO_ERROR;
188
+ });
195
189
}
196
190
197
191
CHIP_ERROR Instance::ReadProgress (AttributeValueEncoder & aEncoder)
@@ -200,19 +194,17 @@ CHIP_ERROR Instance::ReadProgress(AttributeValueEncoder & aEncoder)
200
194
{
201
195
return aEncoder.EncodeNull ();
202
196
}
203
- else
204
- {
205
- return aEncoder.EncodeList ([this ](const auto & encoder) -> CHIP_ERROR {
206
- uint32_t locationIndex = 0 ;
207
- Structs::ProgressStruct::Type progressElement;
208
197
209
- while (mDelegate ->GetProgressElementByIndex (locationIndex++, progressElement))
210
- {
211
- ReturnErrorOnFailure (encoder.Encode (progressElement));
212
- }
213
- return CHIP_NO_ERROR;
214
- });
215
- }
198
+ return aEncoder.EncodeList ([this ](const auto & encoder) -> CHIP_ERROR {
199
+ uint32_t locationIndex = 0 ;
200
+ Structs::ProgressStruct::Type progressElement;
201
+
202
+ while (mDelegate ->GetProgressElementByIndex (locationIndex++, progressElement))
203
+ {
204
+ ReturnErrorOnFailure (encoder.Encode (progressElement));
205
+ }
206
+ return CHIP_NO_ERROR;
207
+ });
216
208
}
217
209
218
210
// *************************************************************************
0 commit comments