directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1331575 - /directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultAttribute.java
Date Fri, 27 Apr 2012 20:24:02 GMT
Author: elecharny
Date: Fri Apr 27 20:24:01 2012
New Revision: 1331575

URL: http://svn.apache.org/viewvc?rev=1331575&view=rev
Log:
Save some CPU by avoiding some useless computaton done on a known upId

Modified:
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultAttribute.java

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultAttribute.java?rev=1331575&r1=1331574&r2=1331575&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultAttribute.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultAttribute.java
Fri Apr 27 20:24:01 2012
@@ -1923,8 +1923,16 @@ public class DefaultAttribute implements
         try
         {
             DefaultAttribute attribute = ( DefaultAttribute ) super.clone();
-            attribute.setUpId( upId );
 
+            if ( this.attributeType != null )
+            {
+                attribute.id = attributeType.getOid();
+                attribute.attributeType = attributeType;
+            }
+            
+            // Compute the hashCode
+            rehash();
+    
             attribute.values = new LinkedHashSet<Value<?>>( values.size() );
 
             for ( Value<?> value : values )



Mime
View raw message