From d552fa556077f94c415a716bbd6f05928f03f2a4 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Thu, 14 Nov 2024 15:49:04 +0100 Subject: [PATCH] Remove const, improve test a bit --- cpp/src/arrow/status.cc | 2 +- cpp/src/arrow/status.h | 2 +- cpp/src/arrow/status_internal.h | 2 +- cpp/src/arrow/status_test.cc | 9 +++++++++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cpp/src/arrow/status.cc b/cpp/src/arrow/status.cc index 81f5f88e0f0d1..8cbc6842c4bc3 100644 --- a/cpp/src/arrow/status.cc +++ b/cpp/src/arrow/status.cc @@ -167,7 +167,7 @@ void Status::AddContextLine(const char* filename, int line, const char* expr) { // We can't add context lines to a StatusConstant's state, so copy it now state_ = new State{code(), /*is_constant=*/false, message(), detail()}; } - const_cast(state_)->msg += ss.str(); + state_->msg += ss.str(); } #endif diff --git a/cpp/src/arrow/status.h b/cpp/src/arrow/status.h index a52a3600e434d..853fc284ee317 100644 --- a/cpp/src/arrow/status.h +++ b/cpp/src/arrow/status.h @@ -375,7 +375,7 @@ class ARROW_EXPORT [[nodiscard]] Status : public util::EqualityComparable