Skip to content

Commit 3a4588f

Browse files
authored
chore(clients): reduce object copying in iterators (#4198)
* chore(reducers): reduce object copying in iterators * chore(codegen): update reducer codegen after rebase
1 parent 12faca2 commit 3a4588f

File tree

229 files changed

+2589
-5110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

229 files changed

+2589
-5110
lines changed

clients/client-accessanalyzer/src/models/models_0.ts

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3429,10 +3429,9 @@ export const RdsDbClusterSnapshotConfigurationFilterSensitiveLog = (obj: RdsDbCl
34293429
...obj,
34303430
...(obj.attributes && {
34313431
attributes: Object.entries(obj.attributes).reduce(
3432-
(acc: any, [key, value]: [string, RdsDbClusterSnapshotAttributeValue]) => ({
3433-
...acc,
3434-
[key]: RdsDbClusterSnapshotAttributeValueFilterSensitiveLog(value),
3435-
}),
3432+
(acc: any, [key, value]: [string, RdsDbClusterSnapshotAttributeValue]) => (
3433+
(acc[key] = RdsDbClusterSnapshotAttributeValueFilterSensitiveLog(value)), acc
3434+
),
34363435
{}
34373436
),
34383437
}),
@@ -3453,10 +3452,9 @@ export const RdsDbSnapshotConfigurationFilterSensitiveLog = (obj: RdsDbSnapshotC
34533452
...obj,
34543453
...(obj.attributes && {
34553454
attributes: Object.entries(obj.attributes).reduce(
3456-
(acc: any, [key, value]: [string, RdsDbSnapshotAttributeValue]) => ({
3457-
...acc,
3458-
[key]: RdsDbSnapshotAttributeValueFilterSensitiveLog(value),
3459-
}),
3455+
(acc: any, [key, value]: [string, RdsDbSnapshotAttributeValue]) => (
3456+
(acc[key] = RdsDbSnapshotAttributeValueFilterSensitiveLog(value)), acc
3457+
),
34603458
{}
34613459
),
34623460
}),
@@ -3529,10 +3527,9 @@ export const S3BucketConfigurationFilterSensitiveLog = (obj: S3BucketConfigurati
35293527
}),
35303528
...(obj.accessPoints && {
35313529
accessPoints: Object.entries(obj.accessPoints).reduce(
3532-
(acc: any, [key, value]: [string, S3AccessPointConfiguration]) => ({
3533-
...acc,
3534-
[key]: S3AccessPointConfigurationFilterSensitiveLog(value),
3535-
}),
3530+
(acc: any, [key, value]: [string, S3AccessPointConfiguration]) => (
3531+
(acc[key] = S3AccessPointConfigurationFilterSensitiveLog(value)), acc
3532+
),
35363533
{}
35373534
),
35383535
}),
@@ -3590,10 +3587,7 @@ export const CreateAccessPreviewRequestFilterSensitiveLog = (obj: CreateAccessPr
35903587
...obj,
35913588
...(obj.configurations && {
35923589
configurations: Object.entries(obj.configurations).reduce(
3593-
(acc: any, [key, value]: [string, Configuration]) => ({
3594-
...acc,
3595-
[key]: ConfigurationFilterSensitiveLog(value),
3596-
}),
3590+
(acc: any, [key, value]: [string, Configuration]) => ((acc[key] = ConfigurationFilterSensitiveLog(value)), acc),
35973591
{}
35983592
),
35993593
}),
@@ -3627,10 +3621,7 @@ export const AccessPreviewFilterSensitiveLog = (obj: AccessPreview): any => ({
36273621
...obj,
36283622
...(obj.configurations && {
36293623
configurations: Object.entries(obj.configurations).reduce(
3630-
(acc: any, [key, value]: [string, Configuration]) => ({
3631-
...acc,
3632-
[key]: ConfigurationFilterSensitiveLog(value),
3633-
}),
3624+
(acc: any, [key, value]: [string, Configuration]) => ((acc[key] = ConfigurationFilterSensitiveLog(value)), acc),
36343625
{}
36353626
),
36363627
}),

clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts

Lines changed: 36 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -2614,10 +2614,8 @@ const serializeAws_restJson1ConfigurationsMap = (
26142614
if (value === null) {
26152615
return acc;
26162616
}
2617-
return {
2618-
...acc,
2619-
[key]: serializeAws_restJson1Configuration(value, context),
2620-
};
2617+
acc[key] = serializeAws_restJson1Configuration(value, context);
2618+
return acc;
26212619
}, {});
26222620
};
26232621

@@ -2680,10 +2678,8 @@ const serializeAws_restJson1FilterCriteriaMap = (input: Record<string, Criterion
26802678
if (value === null) {
26812679
return acc;
26822680
}
2683-
return {
2684-
...acc,
2685-
[key]: serializeAws_restJson1Criterion(value, context),
2686-
};
2681+
acc[key] = serializeAws_restJson1Criterion(value, context);
2682+
return acc;
26872683
}, {});
26882684
};
26892685

@@ -2725,10 +2721,8 @@ const serializeAws_restJson1KmsConstraintsMap = (input: Record<string, string>,
27252721
if (value === null) {
27262722
return acc;
27272723
}
2728-
return {
2729-
...acc,
2730-
[key]: value,
2731-
};
2724+
acc[key] = value;
2725+
return acc;
27322726
}, {});
27332727
};
27342728

@@ -2793,10 +2787,8 @@ const serializeAws_restJson1KmsKeyPoliciesMap = (input: Record<string, string>,
27932787
if (value === null) {
27942788
return acc;
27952789
}
2796-
return {
2797-
...acc,
2798-
[key]: value,
2799-
};
2790+
acc[key] = value;
2791+
return acc;
28002792
}, {});
28012793
};
28022794

@@ -2838,10 +2830,8 @@ const serializeAws_restJson1RdsDbClusterSnapshotAttributesMap = (
28382830
if (value === null) {
28392831
return acc;
28402832
}
2841-
return {
2842-
...acc,
2843-
[key]: serializeAws_restJson1RdsDbClusterSnapshotAttributeValue(value, context),
2844-
};
2833+
acc[key] = serializeAws_restJson1RdsDbClusterSnapshotAttributeValue(value, context);
2834+
return acc;
28452835
}, {});
28462836
};
28472837

@@ -2883,10 +2873,8 @@ const serializeAws_restJson1RdsDbSnapshotAttributesMap = (
28832873
if (value === null) {
28842874
return acc;
28852875
}
2886-
return {
2887-
...acc,
2888-
[key]: serializeAws_restJson1RdsDbSnapshotAttributeValue(value, context),
2889-
};
2876+
acc[key] = serializeAws_restJson1RdsDbSnapshotAttributeValue(value, context);
2877+
return acc;
28902878
}, {});
28912879
};
28922880

@@ -2943,10 +2931,8 @@ const serializeAws_restJson1S3AccessPointConfigurationsMap = (
29432931
if (value === null) {
29442932
return acc;
29452933
}
2946-
return {
2947-
...acc,
2948-
[key]: serializeAws_restJson1S3AccessPointConfiguration(value, context),
2949-
};
2934+
acc[key] = serializeAws_restJson1S3AccessPointConfiguration(value, context);
2935+
return acc;
29502936
}, {});
29512937
};
29522938

@@ -3033,10 +3019,8 @@ const serializeAws_restJson1TagsMap = (input: Record<string, string>, context: _
30333019
if (value === null) {
30343020
return acc;
30353021
}
3036-
return {
3037-
...acc,
3038-
[key]: value,
3039-
};
3022+
acc[key] = value;
3023+
return acc;
30403024
}, {});
30413025
};
30423026

@@ -3288,10 +3272,8 @@ const deserializeAws_restJson1ConditionKeyMap = (output: any, context: __SerdeCo
32883272
if (value === null) {
32893273
return acc;
32903274
}
3291-
return {
3292-
...acc,
3293-
[key]: __expectString(value) as any,
3294-
};
3275+
acc[key] = __expectString(value) as any;
3276+
return acc;
32953277
}, {});
32963278
};
32973279

@@ -3368,10 +3350,8 @@ const deserializeAws_restJson1ConfigurationsMap = (
33683350
if (value === null) {
33693351
return acc;
33703352
}
3371-
return {
3372-
...acc,
3373-
[key]: deserializeAws_restJson1Configuration(__expectUnion(value), context),
3374-
};
3353+
acc[key] = deserializeAws_restJson1Configuration(__expectUnion(value), context);
3354+
return acc;
33753355
}, {});
33763356
};
33773357

@@ -3442,10 +3422,8 @@ const deserializeAws_restJson1FilterCriteriaMap = (output: any, context: __Serde
34423422
if (value === null) {
34433423
return acc;
34443424
}
3445-
return {
3446-
...acc,
3447-
[key]: deserializeAws_restJson1Criterion(value, context),
3448-
};
3425+
acc[key] = deserializeAws_restJson1Criterion(value, context);
3426+
return acc;
34493427
}, {});
34503428
};
34513429

@@ -3603,10 +3581,8 @@ const deserializeAws_restJson1KmsConstraintsMap = (output: any, context: __Serde
36033581
if (value === null) {
36043582
return acc;
36053583
}
3606-
return {
3607-
...acc,
3608-
[key]: __expectString(value) as any,
3609-
};
3584+
acc[key] = __expectString(value) as any;
3585+
return acc;
36103586
}, {});
36113587
};
36123588

@@ -3681,10 +3657,8 @@ const deserializeAws_restJson1KmsKeyPoliciesMap = (output: any, context: __Serde
36813657
if (value === null) {
36823658
return acc;
36833659
}
3684-
return {
3685-
...acc,
3686-
[key]: __expectString(value) as any,
3687-
};
3660+
acc[key] = __expectString(value) as any;
3661+
return acc;
36883662
}, {});
36893663
};
36903664

@@ -3789,10 +3763,8 @@ const deserializeAws_restJson1PrincipalMap = (output: any, context: __SerdeConte
37893763
if (value === null) {
37903764
return acc;
37913765
}
3792-
return {
3793-
...acc,
3794-
[key]: __expectString(value) as any,
3795-
};
3766+
acc[key] = __expectString(value) as any;
3767+
return acc;
37963768
}, {});
37973769
};
37983770

@@ -3817,10 +3789,8 @@ const deserializeAws_restJson1RdsDbClusterSnapshotAttributesMap = (
38173789
if (value === null) {
38183790
return acc;
38193791
}
3820-
return {
3821-
...acc,
3822-
[key]: deserializeAws_restJson1RdsDbClusterSnapshotAttributeValue(__expectUnion(value), context),
3823-
};
3792+
acc[key] = deserializeAws_restJson1RdsDbClusterSnapshotAttributeValue(__expectUnion(value), context);
3793+
return acc;
38243794
},
38253795
{}
38263796
);
@@ -3872,10 +3842,8 @@ const deserializeAws_restJson1RdsDbSnapshotAttributesMap = (
38723842
if (value === null) {
38733843
return acc;
38743844
}
3875-
return {
3876-
...acc,
3877-
[key]: deserializeAws_restJson1RdsDbSnapshotAttributeValue(__expectUnion(value), context),
3878-
};
3845+
acc[key] = deserializeAws_restJson1RdsDbSnapshotAttributeValue(__expectUnion(value), context);
3846+
return acc;
38793847
},
38803848
{}
38813849
);
@@ -3944,10 +3912,8 @@ const deserializeAws_restJson1S3AccessPointConfigurationsMap = (
39443912
if (value === null) {
39453913
return acc;
39463914
}
3947-
return {
3948-
...acc,
3949-
[key]: deserializeAws_restJson1S3AccessPointConfiguration(value, context),
3950-
};
3915+
acc[key] = deserializeAws_restJson1S3AccessPointConfiguration(value, context);
3916+
return acc;
39513917
},
39523918
{}
39533919
);
@@ -4066,10 +4032,8 @@ const deserializeAws_restJson1TagsMap = (output: any, context: __SerdeContext):
40664032
if (value === null) {
40674033
return acc;
40684034
}
4069-
return {
4070-
...acc,
4071-
[key]: __expectString(value) as any,
4072-
};
4035+
acc[key] = __expectString(value) as any;
4036+
return acc;
40734037
}, {});
40744038
};
40754039

clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5906,10 +5906,8 @@ const serializeAws_json1_1AuthorizationResult = (input: Record<string, string>,
59065906
if (value === null) {
59075907
return acc;
59085908
}
5909-
return {
5910-
...acc,
5911-
[key]: value,
5912-
};
5909+
acc[key] = value;
5910+
return acc;
59135911
}, {});
59145912
};
59155913

@@ -8331,10 +8329,8 @@ const deserializeAws_json1_1Reviews = (output: any, context: __SerdeContext): Re
83318329
if (value === null) {
83328330
return acc;
83338331
}
8334-
return {
8335-
...acc,
8336-
[key]: __expectString(value) as any,
8337-
};
8332+
acc[key] = __expectString(value) as any;
8333+
return acc;
83388334
}, {});
83398335
};
83408336

clients/client-amp/src/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,10 +1976,8 @@ const serializeAws_restJson1TagMap = (input: Record<string, string>, context: __
19761976
if (value === null) {
19771977
return acc;
19781978
}
1979-
return {
1980-
...acc,
1981-
[key]: value,
1982-
};
1979+
acc[key] = value;
1980+
return acc;
19831981
}, {});
19841982
};
19851983

@@ -2099,10 +2097,8 @@ const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): R
20992097
if (value === null) {
21002098
return acc;
21012099
}
2102-
return {
2103-
...acc,
2104-
[key]: __expectString(value) as any,
2105-
};
2100+
acc[key] = __expectString(value) as any;
2101+
return acc;
21062102
}, {});
21072103
};
21082104

0 commit comments

Comments
 (0)