Skip to content

Commit 4196a72

Browse files
Small performance optimization.
PiperOrigin-RevId: 304322695
1 parent 08a1ecf commit 4196a72

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

tensorflow_serving/core/aspired_versions_manager.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ void AspiredVersionsManager::ProcessAspiredVersionsRequest(
262262
const std::vector<ServableStateSnapshot<Aspired>> state_snapshots =
263263
basic_manager_->GetManagedServableStateSnapshots<Aspired>(
264264
string(servable_name));
265-
for (const ServableStateSnapshot<Aspired> state_snapshot : state_snapshots) {
265+
for (const ServableStateSnapshot<Aspired>& state_snapshot : state_snapshots) {
266266
if (state_snapshot.additional_state->is_aspired) {
267267
current_aspired_versions.insert(state_snapshot.id.version);
268268
}

tensorflow_serving/model_servers/server.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ Status Server::BuildAndStart(const Options& server_options) {
337337
builder.SetMaxMessageSize(tensorflow::kint32max);
338338
const std::vector<GrpcChannelArgument> channel_arguments =
339339
parseGrpcChannelArgs(server_options.grpc_channel_arguments);
340-
for (GrpcChannelArgument channel_argument : channel_arguments) {
340+
for (const GrpcChannelArgument& channel_argument : channel_arguments) {
341341
// gRPC accept arguments of two types, int and string. We will attempt to
342342
// parse each arg as int and pass it on as such if successful. Otherwise we
343343
// will pass it as a string. gRPC will log arguments that were not accepted.

tensorflow_serving/servables/tensorflow/predict_util.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Status VerifySignature(const SignatureDef& signature) {
4848
template <typename T>
4949
std::set<string> GetMapKeys(const T& proto_map) {
5050
std::set<string> keys;
51-
for (auto it : proto_map) {
51+
for (const auto& it : proto_map) {
5252
keys.insert(it.first);
5353
}
5454
return keys;

tensorflow_serving/util/net_http/client/testing/evhttp_echo_client.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ bool SendRequest(const char* url) {
4343
std::cout << "Response received: " << std::endl
4444
<< "Status: " << response.status << std::endl;
4545

46-
for (auto keyval : response.headers) {
46+
for (const auto& keyval : response.headers) {
4747
std::cout << keyval.first << " : " << keyval.second << std::endl;
4848
}
4949

0 commit comments

Comments
 (0)