]> source.dussan.org Git - aspectj.git/commitdiff
Performance optimization - don't use toString() of a pointcut on the main code path.
authoraclement <aclement>
Tue, 8 Feb 2005 11:14:14 +0000 (11:14 +0000)
committeraclement <aclement>
Tue, 8 Feb 2005 11:14:14 +0000 (11:14 +0000)
weaver/src/org/aspectj/weaver/patterns/PointcutRewriter.java

index 8b725721be7685dd45d0c2c086e0f4bd6c6d8f60..f6383e57581058191cfcb904df0922424ed3600c 100644 (file)
@@ -193,7 +193,8 @@ public class PointcutRewriter {
                        if (element instanceof IfPointcut) {
                                if (((IfPointcut)element).alwaysFalse()) return Pointcut.makeMatchesNothing(element.state);
                        }
-                       if (element.toString().equals("")) return element;  // matches nothing...
+                       // If it can't match anything, the whole AND can't match anything
+                       if (element.couldMatchKinds().isEmpty()) return element;
                }
                if (apc.couldMatchKinds().isEmpty()) return Pointcut.makeMatchesNothing(apc.state);
                // write out with cheapest on left