Skip to content

Commit aa5af54

Browse files
committed
chore: remove contents array from deser functions
1 parent 5f0f5c6 commit aa5af54

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/XmlShapeDeserVisitor.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,10 @@ protected void deserializeCollection(GenerationContext context, CollectionShape
6666
Shape target = context.getModel().expectShape(shape.getMember().getTarget());
6767

6868
// Dispatch to the output value provider for any additional handling.
69-
writer.write("const contents: any = [];");
70-
writer.openBlock("(output || []).map((entry: any) => {", "});", () -> {
69+
writer.openBlock("return (output || []).map((entry: any) => ", ");", () -> {
7170
String dataSource = getUnnamedTargetWrapper(context, target, "entry");
72-
writer.write("contents.push($L);", target.accept(getMemberVisitor(dataSource)));
71+
writer.write("$L", target.accept(getMemberVisitor(dataSource)));
7372
});
74-
writer.write("return contents;");
7573
}
7674

7775
private String getUnnamedTargetWrapper(GenerationContext context, Shape target, String dataSource) {

0 commit comments

Comments
 (0)