Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

THRIFT-5576: fix old-style cast and redundant copy #2597

Merged
merged 1 commit into from Aug 25, 2022

Conversation

kashirin-alex
Copy link
Contributor

Generated was:

class FU_LB : public virtual ::apache::thrift::TBase {
 public:

  FU_LB(const FU_LB&);
  FU_LB(FU_LB&&) noexcept;
  FU_LB& operator=(const FU_LB&);
  FU_LB& operator=(FU_LB&&) noexcept;
  FU_LB() noexcept
        : ctrl(0),
          op((FU_LIST_OP::type)0),
          pos(0) {
    op = (FU_LIST_OP::type)0;

  }

  virtual ~FU_LB() noexcept;

Generated became:

class FU_LB : public virtual ::apache::thrift::TBase {
public:

 FU_LB(const FU_LB&);
 FU_LB(FU_LB&&) noexcept;
 FU_LB& operator=(const FU_LB&);
 FU_LB& operator=(FU_LB&&) noexcept;
 FU_LB() noexcept
       : ctrl(0),
         op(static_cast<FU_LIST_OP::type>(0)),
         pos(0) {
 }

 virtual ~FU_LB() noexcept;

@ctubbsii
Copy link
Member

For convenience, the diff between the two above are:

@@ -7,10 +7,8 @@
   FU_LB& operator=(FU_LB&&) noexcept;
   FU_LB() noexcept
         : ctrl(0),
-          op((FU_LIST_OP::type)0),
+          op(static_cast<FU_LIST_OP::type>(0)),
           pos(0) {
-    op = (FU_LIST_OP::type)0;
-
   }
 
   virtual ~FU_LB() noexcept;

@Jens-G Jens-G merged commit 8ad8d5d into apache:master Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants