Skip to content

Commit 8458024

Browse files
committed
refactor: Use Pair for MsoMdocItem deduplication instead of string concatenation
Replaced string concatenation (namespace + elementIdentifier) used in distinctBy with a Pair(namespace, elementIdentifier). Using string concatenation as a uniqueness key is fragile and can theoretically lead to collisions. A Pair provides structural equality and makes the intent of deduplication explicit and type-safe.
1 parent 8ae47cd commit 8458024

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

common-feature/src/main/java/eu/europa/ec/commonfeature/ui/request/transformer/RequestTransformer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ object RequestTransformer {
186186

187187
val disclosedItems = mDocItems
188188
.distinctBy {
189-
it.namespace + it.elementIdentifier
189+
it.namespace to it.elementIdentifier
190190
} + sdJwtItems
191191

192192
return@mapNotNull if (disclosedItems.isNotEmpty()) {

0 commit comments

Comments
 (0)