Skip to content

Commit 3b8c02d

Browse files
committed
deduplication
1 parent f84e6e4 commit 3b8c02d

File tree

1 file changed

+8
-22
lines changed

1 file changed

+8
-22
lines changed

services/sqs/common/src/aws.sdk.kotlin.services.sqs/SqsMd5ChecksumValidationInterceptor.kt

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -256,19 +256,12 @@ public class SqsMd5ChecksumValidationInterceptor(
256256
.sortedBy { (name, _) -> name }
257257
.forEach { (attributeName, attributeValue) ->
258258
updateLengthAndBytes(buffer, attributeName)
259-
260259
updateLengthAndBytes(buffer, attributeValue.dataType)
261-
262-
val stringValue = attributeValue.stringValue
263-
val binaryValue = attributeValue.binaryValue
264-
val stringListValues = attributeValue.stringListValues
265-
val binaryListValues = attributeValue.binaryListValues
266-
267260
when {
268-
stringValue != null -> updateForStringType(buffer, stringValue)
269-
binaryValue != null -> updateForBinaryType(buffer, binaryValue)
270-
!stringListValues.isNullOrEmpty() -> updateForStringListType(buffer, stringListValues)
271-
!binaryListValues.isNullOrEmpty() -> updateForBinaryListType(buffer, binaryListValues)
261+
attributeValue.stringValue != null -> updateForStringType(buffer, attributeValue.stringValue)
262+
attributeValue.binaryValue != null -> updateForBinaryType(buffer, attributeValue.binaryValue)
263+
!attributeValue.stringListValues.isNullOrEmpty() -> updateForStringListType(buffer, attributeValue.stringListValues)
264+
!attributeValue.binaryListValues.isNullOrEmpty() -> updateForBinaryListType(buffer, attributeValue.binaryListValues)
272265
}
273266
}
274267

@@ -286,19 +279,12 @@ public class SqsMd5ChecksumValidationInterceptor(
286279
.sortedBy { (name, _) -> name.value }
287280
.forEach { (attributeName, attributeValue) ->
288281
updateLengthAndBytes(buffer, attributeName.value)
289-
290282
updateLengthAndBytes(buffer, attributeValue.dataType)
291-
292-
val stringValue = attributeValue.stringValue
293-
val binaryValue = attributeValue.binaryValue
294-
val stringListValues = attributeValue.stringListValues
295-
val binaryListValues = attributeValue.binaryListValues
296-
297283
when {
298-
stringValue != null -> updateForStringType(buffer, stringValue)
299-
binaryValue != null -> updateForBinaryType(buffer, binaryValue)
300-
!stringListValues.isNullOrEmpty() -> updateForStringListType(buffer, stringListValues)
301-
!binaryListValues.isNullOrEmpty() -> updateForBinaryListType(buffer, binaryListValues)
284+
attributeValue.stringValue != null -> updateForStringType(buffer, attributeValue.stringValue)
285+
attributeValue.binaryValue != null -> updateForBinaryType(buffer, attributeValue.binaryValue)
286+
!attributeValue.stringListValues.isNullOrEmpty() -> updateForStringListType(buffer, attributeValue.stringListValues)
287+
!attributeValue.binaryListValues.isNullOrEmpty() -> updateForBinaryListType(buffer, attributeValue.binaryListValues)
302288
}
303289
}
304290

0 commit comments

Comments
 (0)