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

Removed extra parentheses on eastl::move's return statement #409

Merged
merged 1 commit into from
Jan 7, 2021

Conversation

Razakhel
Copy link
Contributor

This silences a specific clang-tidy check when using the pass-by-value + move idiom

class Foo
{
public:
    Foo(eastl::string str)
        : m_str{ eastl::move(str) }
    {}

private:
    eastl::string m_str;
};
warning: the parameter 'str' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
        Foo(eastl::string str)
                          ^
            const        &

With the change introduced with this PR, this warning disappears.

- This silences a specific clang-tidy check when using the pass-by-value + move idiom
@MaxEWinkler
Copy link
Contributor

Looks good. Thanks for great find :).

@MaxEWinkler MaxEWinkler merged commit dda5082 into electronicarts:master Jan 7, 2021
@Razakhel Razakhel deleted the move_extra_parentheses branch January 8, 2021 21:36
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

2 participants