WhiteCat22 commented on a change in pull request #407: [CXF-7716] Reduce
StringBuilders and other performance changes.
URL: https://github.com/apache/cxf/pull/407#discussion_r183534925
##########
File path:
rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
##########
@@ -1508,11 +1509,40 @@ public static boolean matchMimeTypes(MediaType
requestContentType,
}
}
}
-
return new ArrayList<>(supportedMimeTypeList);
+ }
+
+ public static boolean doMimeTypesIntersect(List<MediaType>
requiredMediaTypes, List<MediaType> userMediaTypes) {
+ for (MediaType requiredType : requiredMediaTypes) {
Review comment:
The performance increase comes from not making a HashSet just to do the
comparison. I agree that duplicating code is not ideal, but I'm not sure how to
accomplish both cases with a single method.
I am open to suggestions.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services