diff options
author | Tor Brede Vekterli <vekterli@vespa.ai> | 2024-04-09 15:01:32 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@vespa.ai> | 2024-04-09 15:01:32 +0000 |
commit | 0533ce61bae90afc84798f8fecba24d5a5ccee20 (patch) | |
tree | dc19ddbae9db793d8a799c403f4f738cd6d48b59 | |
parent | 8866927d906a9869d668587bd1c12ddec367a59c (diff) |
Use `static_cast` instead of `dynamic_cast`
Downcast-safe type invariant shall be maintained by the message's
own type ID tracking. If it's not, we have bigger problems.
-rw-r--r-- | storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp index 2e2634025a7..6365eb1ab30 100644 --- a/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp +++ b/storage/src/vespa/storage/persistence/filestorage/filestorhandlerimpl.cpp @@ -1027,11 +1027,11 @@ constexpr bool is_batchable_feed_op(api::MessageType::Id id) noexcept { document::GlobalId gid_from_feed_op(const api::StorageMessage& msg) { switch (msg.getType().getId()) { case api::MessageType::PUT_ID: - return dynamic_cast<const api::PutCommand&>(msg).getDocumentId().getGlobalId(); + return static_cast<const api::PutCommand&>(msg).getDocumentId().getGlobalId(); case api::MessageType::REMOVE_ID: - return dynamic_cast<const api::RemoveCommand&>(msg).getDocumentId().getGlobalId(); + return static_cast<const api::RemoveCommand&>(msg).getDocumentId().getGlobalId(); case api::MessageType::UPDATE_ID: - return dynamic_cast<const api::UpdateCommand&>(msg).getDocumentId().getGlobalId(); + return static_cast<const api::UpdateCommand&>(msg).getDocumentId().getGlobalId(); default: abort(); } } |