Skip to content

Commit

Permalink
Remove redundant loop flag
Browse files Browse the repository at this point in the history
  • Loading branch information
kanderson250 committed Mar 5, 2024
1 parent 53f5c9c commit c5ff850
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,12 @@ static W3CTraceParent parseHeaders(List<String> traceParentHeaders) {
ServiceFactory.getStatsService().getMetricAggregator().incrementCounter(MetricNames.SUPPORTABILITY_TRACE_CONTEXT_INVALID_PARENT_HEADER_COUNT);
Agent.LOG.log(Level.WARNING, "Multiple traceparent headers found on inbound request.");
// Multiple values ok if all are equal
boolean allHeadersEqual = true;
String first = traceParentHeaders.get(0);
for (String header : traceParentHeaders) {
if (!header.equals(first)) {
allHeadersEqual = false;
break;
return null;
}
}
if (!allHeadersEqual) {
return null;
}
}
String traceParentHeader = traceParentHeaders.get(0);
return parseHeader(traceParentHeader);
Expand Down

0 comments on commit c5ff850

Please sign in to comment.