From 67ef5e265751297e19bed06372330dfc2124cd73 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 13 Feb 2006 10:51:24 +0000 Subject: [PATCH] lessen the cost of hashcode and equals --- .../aspectj/weaver/patterns/NamePattern.java | 13 +++++++--- .../weaver/patterns/SignaturePattern.java | 25 +++++++++++-------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/patterns/NamePattern.java b/weaver/src/org/aspectj/weaver/patterns/NamePattern.java index 45f4b154a..abcceb841 100644 --- a/weaver/src/org/aspectj/weaver/patterns/NamePattern.java +++ b/weaver/src/org/aspectj/weaver/patterns/NamePattern.java @@ -21,6 +21,7 @@ import org.aspectj.weaver.VersionedDataInputStream; public class NamePattern extends PatternNode { char[] pattern; int starCount = 0; + private int hashcode = -1; public static final NamePattern ELLIPSIS = new NamePattern(""); public static final NamePattern ANY = new NamePattern("*"); @@ -35,6 +36,7 @@ public class NamePattern extends PatternNode { for (int i=0, len=pattern.length; i