@@ -248,38 +248,50 @@ OptionValueProperties::GetPropertyAtIndexAsOptionValueLanguage(
248
248
bool OptionValueProperties::GetPropertyAtIndexAsArgs (
249
249
const ExecutionContext *exe_ctx, uint32_t idx, Args &args) const {
250
250
const Property *property = GetPropertyAtIndex (exe_ctx, false , idx);
251
- if (property) {
252
- OptionValue *value = property->GetValue ().get ();
253
- if (value) {
254
- const OptionValueArray *array = value->GetAsArray ();
255
- if (array)
256
- return array->GetArgs (args);
257
- else {
258
- const OptionValueDictionary *dict = value->GetAsDictionary ();
259
- if (dict)
260
- return dict->GetArgs (args);
261
- }
262
- }
263
- }
251
+ if (!property)
252
+ return false ;
253
+
254
+ OptionValue *value = property->GetValue ().get ();
255
+ if (!value)
256
+ return false ;
257
+
258
+ const OptionValueArgs *arguments = value->GetAsArgs ();
259
+ if (arguments)
260
+ return arguments->GetArgs (args);
261
+
262
+ const OptionValueArray *array = value->GetAsArray ();
263
+ if (array)
264
+ return array->GetArgs (args);
265
+
266
+ const OptionValueDictionary *dict = value->GetAsDictionary ();
267
+ if (dict)
268
+ return dict->GetArgs (args);
269
+
264
270
return false ;
265
271
}
266
272
267
273
bool OptionValueProperties::SetPropertyAtIndexFromArgs (
268
274
const ExecutionContext *exe_ctx, uint32_t idx, const Args &args) {
269
275
const Property *property = GetPropertyAtIndex (exe_ctx, true , idx);
270
- if (property) {
271
- OptionValue *value = property->GetValue ().get ();
272
- if (value) {
273
- OptionValueArray *array = value->GetAsArray ();
274
- if (array)
275
- return array->SetArgs (args, eVarSetOperationAssign).Success ();
276
- else {
277
- OptionValueDictionary *dict = value->GetAsDictionary ();
278
- if (dict)
279
- return dict->SetArgs (args, eVarSetOperationAssign).Success ();
280
- }
281
- }
282
- }
276
+ if (!property)
277
+ return false ;
278
+
279
+ OptionValue *value = property->GetValue ().get ();
280
+ if (!value)
281
+ return false ;
282
+
283
+ OptionValueArgs *arguments = value->GetAsArgs ();
284
+ if (arguments)
285
+ return arguments->SetArgs (args, eVarSetOperationAssign).Success ();
286
+
287
+ OptionValueArray *array = value->GetAsArray ();
288
+ if (array)
289
+ return array->SetArgs (args, eVarSetOperationAssign).Success ();
290
+
291
+ OptionValueDictionary *dict = value->GetAsDictionary ();
292
+ if (dict)
293
+ return dict->SetArgs (args, eVarSetOperationAssign).Success ();
294
+
283
295
return false ;
284
296
}
285
297
0 commit comments