diff options
author | Chih-Hung Hsieh <chh@google.com> | 2016-07-27 23:09:24 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-07-27 23:09:24 +0000 |
commit | 5ad3008a15b7a141810397ae64a906a2a0691203 (patch) | |
tree | 9b5a1f784a96ac21a7db9835298691207a70dfe3 | |
parent | c103ba6fcd3653f23090fdee56df0470cf3dac97 (diff) | |
parent | 67cb971d4b7abdd2ddc82456a63199aaf99173f0 (diff) | |
download | webservd-5ad3008a15b7a141810397ae64a906a2a0691203.tar.gz |
Fix clang-tidy performance warnings in webservd.
am: 67cb971d4b
Change-Id: If9a7c894452fd26b2a9b4626e462d0003f871470
-rw-r--r-- | libwebserv/binder_server.cc | 6 | ||||
-rw-r--r-- | libwebserv/binder_server.h | 2 | ||||
-rw-r--r-- | libwebserv/request_utils.cc | 4 | ||||
-rw-r--r-- | webservd/binder_server.cc | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/libwebserv/binder_server.cc b/libwebserv/binder_server.cc index 3cce096..3018480 100644 --- a/libwebserv/binder_server.cc +++ b/libwebserv/binder_server.cc @@ -99,7 +99,7 @@ class BinderProtocolHandler : public ProtocolHandler { ResetRemoteProtocolHandlers(); } - bool AddRemote(sp<IProtocolHandler> handler) { + bool AddRemote(const sp<IProtocolHandler>& handler) { string name; int32_t port; string protocol; @@ -138,7 +138,7 @@ class BinderProtocolHandler : public ProtocolHandler { unique_ptr<RequestHandlerRegistration> registration( new RequestHandlerRegistration(url, method, std::move(handler))); - for (sp<IProtocolHandler> remote : remote_handlers_) { + for (const sp<IProtocolHandler>& remote : remote_handlers_) { registration->AddRemote(remote); } @@ -257,7 +257,7 @@ void BinderServer::ClearLocalState() { remote_server_.clear(); } -bool BinderServer::BuildLocalState(sp<IBinder> server) { +bool BinderServer::BuildLocalState(const sp<IBinder>& server) { remote_server_ = android::interface_cast<RemoteServer>(server); vector<sp<IBinder>> remote_raw_binders; if (!remote_server_->GetProtocolHandlers("", &remote_raw_binders).isOk()) { diff --git a/libwebserv/binder_server.h b/libwebserv/binder_server.h index 2e21cfe..98da60b 100644 --- a/libwebserv/binder_server.h +++ b/libwebserv/binder_server.h @@ -66,7 +66,7 @@ class LIBWEBSERV_PRIVATE BinderServer : public Server { void TryConnecting(); void ClearLocalState(); - bool BuildLocalState(android::sp<android::IBinder> server); + bool BuildLocalState(const android::sp<android::IBinder>& server); // Used to poll for webservd availability and notify the user of changes brillo::MessageLoop* message_loop_; diff --git a/libwebserv/request_utils.cc b/libwebserv/request_utils.cc index 879f8b2..0c65025 100644 --- a/libwebserv/request_utils.cc +++ b/libwebserv/request_utils.cc @@ -32,7 +32,7 @@ struct RequestDataContainer { std::vector<uint8_t> data; }; -void OnCopySuccess(std::shared_ptr<RequestDataContainer> container, +void OnCopySuccess(const std::shared_ptr<RequestDataContainer>& container, brillo::StreamPtr /* in_stream */, brillo::StreamPtr out_stream, uint64_t /* size_copied */) { @@ -44,7 +44,7 @@ void OnCopySuccess(std::shared_ptr<RequestDataContainer> container, std::move(container->data)); } -void OnCopyError(std::shared_ptr<RequestDataContainer> container, +void OnCopyError(const std::shared_ptr<RequestDataContainer>& container, brillo::StreamPtr /* in_stream */, brillo::StreamPtr /* out_stream */, const brillo::Error* error) { diff --git a/webservd/binder_server.cc b/webservd/binder_server.cc index bc588cb..ede4854 100644 --- a/webservd/binder_server.cc +++ b/webservd/binder_server.cc @@ -282,7 +282,7 @@ Status BinderServer::GetProtocolHandlers( vector<sp<IBinder>>* result) { result->clear(); - for (auto handler : protocol_handlers_) { + for (const auto& handler : protocol_handlers_) { string handler_name; if (name.empty()) { |