core: Avoid frequently computing inprocess useragent

This commit is contained in:
Eric Anderson 2017-12-11 15:29:15 -08:00
parent 11b5c1a7c1
commit 2ea77cce1e
1 changed files with 2 additions and 4 deletions

View File

@ -87,7 +87,7 @@ final class InProcessTransport implements ServerTransport, ConnectionClientTrans
public InProcessTransport(String name, String authority, String userAgent) {
this.name = name;
this.authority = authority;
this.userAgent = userAgent;
this.userAgent = GrpcUtil.getGrpcUserAgent("inprocess", userAgent);
}
@CheckReturnValue
@ -146,9 +146,7 @@ final class InProcessTransport implements ServerTransport, ConnectionClientTrans
}
};
}
headers.put(
GrpcUtil.USER_AGENT_KEY,
GrpcUtil.getGrpcUserAgent("inprocess", userAgent));
headers.put(GrpcUtil.USER_AGENT_KEY, userAgent);
return new InProcessStream(method, headers, callOptions, authority).clientStream;
}