chibenwa commented on a change in pull request #518:
URL: https://github.com/apache/james-project/pull/518#discussion_r662685481



##########
File path: 
server/protocols/jmap/src/main/java/org/apache/james/jmap/VersionParser.java
##########
@@ -47,37 +52,34 @@ public VersionParser(Set<Version> supportedVersions, 
JMAPConfiguration jmapConfi
         
Preconditions.checkArgument(supportedVersions.contains(jmapConfiguration.getDefaultVersion()),
                 "%s is not a supported JMAP version", jmapConfiguration);
 
-        this.supportedVersions = supportedVersions;
+        this.supportedVersions = supportedVersions.stream()
+            .collect(Guavate.toImmutableMap(version -> 
version.asString().toLowerCase(Locale.US)));

Review comment:
       Lookup in a map is O(1) - globally, lookup in a set iterating elements 
is O(n).
   
   Also initiating the pipeline is quite expensive - we do execute it on each 
JMAP request so quite often... 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to