You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by nf...@apache.org on 2024/07/26 06:21:40 UTC

(jackrabbit-oak) branch trunk updated: OAK-10976 - Avoid unnecessary call to PathUtils.getName in IndexDefinition (#1603)

This is an automated email from the ASF dual-hosted git repository.

nfsantos pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git


The following commit(s) were added to refs/heads/trunk by this push:
     new ffbd5daa29 OAK-10976 - Avoid unnecessary call to PathUtils.getName in IndexDefinition (#1603)
ffbd5daa29 is described below

commit ffbd5daa2965799dd34471f23aca6d65d1e87c5f
Author: Nuno Santos <ns...@adobe.com>
AuthorDate: Fri Jul 26 08:21:35 2024 +0200

    OAK-10976 - Avoid unnecessary call to PathUtils.getName in IndexDefinition (#1603)
---
 .../org/apache/jackrabbit/oak/plugins/index/search/IndexDefinition.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/IndexDefinition.java b/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/IndexDefinition.java
index 45ad59e231..ffe2dba720 100644
--- a/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/IndexDefinition.java
+++ b/oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/IndexDefinition.java
@@ -1525,10 +1525,10 @@ public class IndexDefinition implements Aggregate.AggregateMapper {
          */
         boolean matches(String propertyPath) {
             String parentPath = getParentPath(propertyPath);
-            String propertyName = PathUtils.getName(propertyPath);
             if (!this.parentPath.equals(parentPath)) {
                 return false;
             }
+            String propertyName = PathUtils.getName(propertyPath);
             return pattern.matcher(propertyName).matches();
         }