tom-s-powell opened a new pull request, #16860: URL: https://github.com/apache/iceberg/pull/16860
https://github.com/apache/iceberg/blob/a165b1c1551dcdb215fb10a610f7d29edfa25df3/core/src/main/java/org/apache/iceberg/TableMetadata.java#L1018-L1020 and https://github.com/apache/iceberg/blob/a165b1c1551dcdb215fb10a610f7d29edfa25df3/core/src/main/java/org/apache/iceberg/TableMetadata.java#L1508 are guarding against multiple `EncryptedKey` with the same `key-id`. As such it would be more efficient to remove `keyId` from `keysById` first, the result of which will determine whether the key exists or not. We can then use `encryptionKeys.remove` to remove the _first_ (and only) occurrence of `EncryptedKey` rather than `encryptionKeys.removeIf` which will iterate through the entire list of encryption keys unnecessarily even after removing the only occurrence. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
