Skip to content

Commit

Permalink
chore: remove redundant return from xml serialize (#1182)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr authored May 14, 2020
1 parent 5a92d6b commit 117e9ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ protected void serializeCollection(GenerationContext context, CollectionShape sh
writer.openBlock("return node.reduce((acc: __XmlNode, workingNode: any) => {", "}", () -> {
// Add @xmlNamespace value of the target member.
AwsProtocolUtils.writeXmlNamespace(context, memberShape, "workingNode");
writer.write("acc.addChildNode(workingNode);");
writer.write("return acc;");
writer.write("return acc.addChildNode(workingNode);");
});
writer.write(", new __XmlNode($S));", locationName);
} else {
Expand Down Expand Up @@ -134,8 +133,7 @@ protected void serializeMap(GenerationContext context, MapShape shape) {
writer.openBlock("node.reduce((acc: __XmlNode, workingNode: any) => {", "}", () -> {
// Add @xmlNamespace value of the value member.
AwsProtocolUtils.writeXmlNamespace(context, valueMember, "workingNode");
writer.write("acc.addChildNode(workingNode);");
writer.write("return acc;");
writer.write("return acc.addChildNode(workingNode);");
});
writer.write(", new __XmlNode($S));", valueName);
});
Expand Down
3 changes: 1 addition & 2 deletions protocol_tests/aws-restxml/protocols/Aws_restXml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4440,8 +4440,7 @@ const serializeAws_restXmlNestedStringList = (
return input.map(entry => {
const node = serializeAws_restXmlStringList(entry, context);
return node.reduce((acc: __XmlNode, workingNode: any) => {
acc.addChildNode(workingNode);
return acc;
return acc.addChildNode(workingNode);
}, new __XmlNode("member"));
});
};
Expand Down

0 comments on commit 117e9ca

Please sign in to comment.