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

Apply modernize pass by value #3340

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

bernardnormier
Copy link
Member

Updates using clang-tidy -fix option.

Performance wide I believe there is no change since clang-tidy didn't update the calling sites to std::move the argument when possible.

const ReferencePtr& reference,
const Ice::ConnectionIPtr& connection,
bool compress)
FixedRequestHandler::FixedRequestHandler(const ReferencePtr& reference, Ice::ConnectionIPtr connection, bool compress)
: RequestHandler(reference),
Copy link
Member

@pepone pepone Jan 11, 2025

Choose a reason for hiding this comment

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

No clear why RequestHandler was not updated.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know. This PR's focus is automated updates.

@@ -128,9 +129,9 @@ namespace
}
}

ConnectionFlushBatchAsync::ConnectionFlushBatchAsync(const ConnectionIPtr& connection, const InstancePtr& instance)
ConnectionFlushBatchAsync::ConnectionFlushBatchAsync(ConnectionIPtr connection, const InstancePtr& instance)
: OutgoingAsyncBase(instance),
Copy link
Member

Choose a reason for hiding this comment

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

Why was instance not updated here?

@@ -15,7 +15,9 @@
# include "TcpAcceptor.h"
# include "TcpConnector.h"
# include "TcpEndpointI.h"

Copy link
Member

Choose a reason for hiding this comment

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

The new line here seems odd, is only "TcpEndpointI.h" that should be treated specially the orders should stay alphabetically sorted.

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed all these extra newlines.

@@ -12,6 +13,7 @@
#include "ProtocolInstance.h"
#include "UdpConnector.h"
#include "UdpTransceiver.h"
#include <utility>
Copy link
Member

Choose a reason for hiding this comment

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

I think in most sources we have a new lien between Ice and other headers, I guess the clang-tidy added those and doesn't know this rule.

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed most of the new include <utility>

cpp/src/IceDB/IceDB.h Outdated Show resolved Hide resolved
cpp/src/IceDB/IceDB.h Outdated Show resolved Hide resolved
@@ -116,7 +117,7 @@ namespace IceDiscovery
class LookupI final : public Lookup, public std::enable_shared_from_this<LookupI>
{
public:
LookupI(const LocatorRegistryIPtr&, const LookupPrx&, const Ice::PropertiesPtr&);
LookupI(LocatorRegistryIPtr, const LookupPrx&, const Ice::PropertiesPtr&);
Copy link
Member

Choose a reason for hiding this comment

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

LookupPrx should be passed by value and moved.

@@ -110,9 +112,9 @@ BaseSessionI::getGlacier2AdapterIdSet()
return _servantManager->getGlacier2AdapterIdSet(shared_from_this());
}

SessionI::SessionI(const string& id, const shared_ptr<Database>& database, const IceInternal::TimerPtr& timer)
SessionI::SessionI(const string& id, const shared_ptr<Database>& database, IceInternal::TimerPtr timer)
Copy link
Member

Choose a reason for hiding this comment

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

I guess id was not updated by this auto-fix because it is own by the base class, I assume we will get other warnings that allow to easy fix the callers.

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.

3 participants