pitrou commented on code in PR #46017: URL: https://github.com/apache/arrow/pull/46017#discussion_r2195222379
########## cpp/src/parquet/encryption/encryption.cc: ########## @@ -26,31 +26,30 @@ #include "arrow/util/utf8.h" #include "parquet/encryption/encryption_internal.h" -namespace parquet { +using ::arrow::util::SecureString; -// integer key retriever -void IntegerKeyIdRetriever::PutKey(uint32_t key_id, const std::string& key) { - key_map_.insert({key_id, key}); -} +namespace parquet { -std::string IntegerKeyIdRetriever::GetKey(const std::string& key_metadata) { - uint32_t key_id; - memcpy(reinterpret_cast<uint8_t*>(&key_id), key_metadata.c_str(), 4); +// any empty SecureString key is interpreted as if no key is given +// this instance is used when a SecureString reference is returned +const SecureString no_key_ = SecureString(); Review Comment: The naming is a bit off as the trailing underscore is used for member variables. You could make it `kNoKey` for example. (can also make it `static` by the way) -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org