Source:
<code>private void updateResponseHeader(RxDocumentServiceRequest request, HttpHeaders headers) { String requestConsistencyLevel = request.getHeaders().get(HttpConstants.Headers.CONSISTENCY_LEVEL); boolean sessionConsistency = this.serviceConfigurationReader.getDefaultConsistencyLevel() == ConsistencyLevel.SESSION || (!Strings.isNullOrEmpty(requestConsistencyLevel) && Strings.areEqualIgnoreCase(requestConsistencyLevel, ConsistencyLevel.SESSION.toString())); long storeLSN = this.getLSN(headers); if (storeLSN == -1) { return; } <START> String partitionKeyRangeId = headers.getValue(WFConstants.BackendHeaders.PARTITION_KEY_RANGE_ID); <END> if (Strings.isNullOrEmpty(partitionKeyRangeId)) { String inputSession = request.getHeaders().get(HttpConstants.Headers.SESSION_TOKEN); if (!Strings.isNullOrEmpty(inputSession) && inputSession.indexOf(ISessionToken.PARTITION_KEY_RANGE_SESSION_SEPARATOR) >= 1) { partitionKeyRangeId = inputSession.substring(0, inputSession.indexOf(ISessionToken.PARTITION_KEY_RANGE_SESSION_SEPARATOR)); } else { partitionKeyRangeId = ZERO_PARTITION_KEY_RANGE; } } ISessionToken sessionToken = null; String sessionTokenResponseHeader = headers.getValue(HttpConstants.Headers.SESSION_TOKEN); if (!Strings.isNullOrEmpty(sessionTokenResponseHeader)) { sessionToken = SessionTokenHelper.parse(sessionTokenResponseHeader); } if (sessionToken != null) { headers.put(HttpConstants.Headers.SESSION_TOKEN, SessionTokenHelper.concatPartitionKeyRangeIdWithSessionToken(partitionKeyRangeId, sessionToken.convertToString())); } headers.remove(WFConstants.BackendHeaders.PARTITION_KEY_RANGE_ID); }</code><technical_language>perf impact? invocation HttpHeaders.getValue(name) invoke name.toLower <LINK_0> other places</technical_language>

Target:
private void updateResponseHeader(RxDocumentServiceRequest request, HttpHeaders headers) { String requestConsistencyLevel = request.getHeaders().getValue(HttpConstants.Headers.CONSISTENCY_LEVEL); boolean sessionConsistency = this.serviceConfigurationReader.getDefaultConsistencyLevel() == ConsistencyLevel.SESSION || (!Strings.isNullOrEmpty(requestConsistencyLevel) && Strings.areEqualIgnoreCase(requestConsistencyLevel, ConsistencyLevel.SESSION.toString())); long storeLSN = this.getLSN(headers); if (storeLSN == -1) { return; } String partitionKeyRangeId = headers.getValue(WFConstants.BackendHeaders.PARTITION_KEY_RANGE_ID); if (Strings.isNullOrEmpty(partitionKeyRangeId)) { String inputSession = request.getHeaders().getValue(HttpConstants.Headers.SESSION_TOKEN); if (!Strings.isNullOrEmpty(inputSession) && inputSession.indexOf(ISessionToken.PARTITION_KEY_RANGE_SESSION_SEPARATOR) >= 1) { partitionKeyRangeId = inputSession.substring(0, inputSession.indexOf(ISessionToken.PARTITION_KEY_RANGE_SESSION_SEPARATOR)); } else { partitionKeyRangeId = ZERO_PARTITION_KEY_RANGE; } } ISessionToken sessionToken = null; String sessionTokenResponseHeader = headers.getValue(HttpConstants.Headers.SESSION_TOKEN); if (!Strings.isNullOrEmpty(sessionTokenResponseHeader)) { sessionToken = SessionTokenHelper.parse(sessionTokenResponseHeader); } if (sessionToken != null) { headers.put(HttpConstants.Headers.SESSION_TOKEN, SessionTokenHelper.concatPartitionKeyRangeIdWithSessionToken(partitionKeyRangeId, sessionToken.convertToString())); } headers.remove(WFConstants.BackendHeaders.PARTITION_KEY_RANGE_ID); }