openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r1354265 - /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Audited.java
Date Tue, 26 Jun 2012 22:11:50 GMT
Author: ppoddar
Date: Tue Jun 26 22:11:49 2012
New Revision: 1354265

URL: http://svn.apache.org/viewvc?rev=1354265&view=rev
Log:
OPENJPA-2030: Collect dirty fields with a smarter loop

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Audited.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Audited.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Audited.java?rev=1354265&r1=1354264&r2=1354265&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Audited.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Audited.java Tue
Jun 26 22:11:49 2012
@@ -72,10 +72,8 @@ public final class Audited {
 		BitSet dirty = _sm.getDirty();
 		String[] names = new String[dirty.cardinality()];
 		int j = 0;
-		for (int i = 0; i < dirty.size(); i++) {
-			if (dirty.get(i)) {
-				names[j++] = _sm.getMetaData().getField(i).getName();
-			}
+		for (int pos = dirty.nextSetBit(0); pos != -1; pos = dirty.nextSetBit(pos+1)) {
+			names[j++] = _sm.getMetaData().getField(pos).getName();
 		}
 		return names;
 	}



Mime
View raw message