[ 
https://issues.apache.org/jira/browse/CAMEL-11348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16038268#comment-16038268
 ] 

ASF GitHub Bot commented on CAMEL-11348:
----------------------------------------

GitHub user onders86 opened a pull request:

    https://github.com/apache/camel/pull/1739

    CAMEL-11348 - small optimization & cs fix in MethodInfo

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/onders86/camel CAMEL-11348

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/1739.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1739
    
----
commit b1188a70609524b9fa8811e3a3e0afbef7d7585d
Author: onders86 <[email protected]>
Date:   2017-06-06T06:29:06Z

    CAMEL-11348 - small optimization & cs fix in MethodInfo

----


> Small Performance optimization in RestConsumerContextPathMatcher
> ----------------------------------------------------------------
>
>                 Key: CAMEL-11348
>                 URL: https://issues.apache.org/jira/browse/CAMEL-11348
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core, rest
>    Affects Versions: 2.19.0
>            Reporter: Zoltan Farkas
>            Assignee: Andrea Cosentino
>            Priority: Minor
>             Fix For: 2.20.0
>
>
> at 
> https://github.com/apache/camel/blob/57711e2696c32ef3ab99ad4ccc62f09bfda2ab40/camel-core/src/main/java/org/apache/camel/support/RestConsumerContextPathMatcher.java#L97
>   :
> {code}
>         String p1 = requestPath.toLowerCase(Locale.ENGLISH);
>         String p2 = consumerPath.toLowerCase(Locale.ENGLISH);
>         if (p1.equals(p2)) {
>             return true;
>         }
>         if (matchOnUriPrefix && p1.startsWith(p2)) {
>             return true;
>         }
>         return false;
> {code}
> we can improve to:
> {code}
>     if (requestPath.equalsIgnoreCase(consumerPath)) {
>       return true;
>     }
>     return matchOnUriPrefix && requestPath.regionMatches(true, 0, 
> consumerPath, 0, consumerPath.length());
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to