diff --git a/gems/aws-sdk-core/lib/aws-sdk-core/query/ec2_param_builder.rb b/gems/aws-sdk-core/lib/aws-sdk-core/query/ec2_param_builder.rb index 3cbbd04cac5..e48bfe47bdf 100644 --- a/gems/aws-sdk-core/lib/aws-sdk-core/query/ec2_param_builder.rb +++ b/gems/aws-sdk-core/lib/aws-sdk-core/query/ec2_param_builder.rb @@ -31,13 +31,11 @@ def structure(ref, values, prefix) end def list(ref, values, prefix) - if values.empty? - set(prefix, '') - else - member_ref = ref.shape.member - values.each.with_index do |value, n| - format(member_ref, value, "#{prefix}.#{n+1}") - end + return if values.empty? + + member_ref = ref.shape.member + values.each.with_index do |value, n| + format(member_ref, value, "#{prefix}.#{n + 1}") end end