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

fix: remove redundant moves #4565

Merged
merged 3 commits into from Jun 10, 2023
Merged

Conversation

ckeshava
Copy link
Collaborator

@ckeshava ckeshava commented Jun 9, 2023

High Level Overview of Change

This PR removes redundant use of std::move in the codebase. Since the types are trivially-copyable, the compiler will copy it despite the usage of std::move.

I've also removed an unused import in one of the unit test files, I noticed it while working on something else.

As a sidenote, do you guys know of any tools to clean up unused imports? There seem to be many in the rippled codebase.

@seelabs thanks for pointing out the compiler warnings. Can you please review this PR?

Context of Change

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates
  • Release

@ckeshava ckeshava requested a review from drlongle June 9, 2023 19:09
@ckeshava ckeshava self-assigned this Jun 9, 2023
@ckeshava
Copy link
Collaborator Author

ckeshava commented Jun 9, 2023

@HowardHinnant can you please review this?

@intelliot intelliot requested review from seelabs and HowardHinnant and removed request for drlongle June 9, 2023 21:01
Copy link
Collaborator

@seelabs seelabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@intelliot
Copy link
Collaborator

Suggested commit message:

fix: remove redundant moves (#4565)

- Resolve gcc compiler warning:
      AccountObjects.cpp:182:47: warning: redundant move in initialization [-Wredundant-move]
  - The std::move() operation on trivially copyable types may generate a
    compile warning in newer versions of gcc.
- Remove extraneous header (unused imports) from a unit test file.

@intelliot intelliot added this to the 1.11.0 milestone Jun 9, 2023
- Resolve gcc compiler warning:
      AccountObjects.cpp:182:47: warning: redundant move in initialization [-Wredundant-move]
  - The std::move() operation on trivially copyable types may generate a
    compile warning in newer versions of gcc.
- Remove extraneous header (unused imports) from a unit test file.
@intelliot intelliot merged commit 77c0a62 into XRPLF:develop Jun 10, 2023
7 checks passed
@intelliot intelliot changed the title Move optimization patch fix: remove redundant moves Jun 10, 2023
@ximinez ximinez removed their request for review June 12, 2023 21:13
ckeshava added a commit to ckeshava/rippled that referenced this pull request Jul 10, 2023
- Resolve gcc compiler warning:
      AccountObjects.cpp:182:47: warning: redundant move in initialization [-Wredundant-move]
  - The std::move() operation on trivially copyable types may generate a
    compile warning in newer versions of gcc.
- Remove extraneous header (unused imports) from a unit test file.
ckeshava added a commit to ckeshava/rippled that referenced this pull request Sep 22, 2023
- Resolve gcc compiler warning:
      AccountObjects.cpp:182:47: warning: redundant move in initialization [-Wredundant-move]
  - The std::move() operation on trivially copyable types may generate a
    compile warning in newer versions of gcc.
- Remove extraneous header (unused imports) from a unit test file.
ckeshava added a commit to ckeshava/rippled that referenced this pull request Sep 25, 2023
- Resolve gcc compiler warning:
      AccountObjects.cpp:182:47: warning: redundant move in initialization [-Wredundant-move]
  - The std::move() operation on trivially copyable types may generate a
    compile warning in newer versions of gcc.
- Remove extraneous header (unused imports) from a unit test file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants