svn commit: r685945 - /ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r685945 - /ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java

doogie-3
Author: doogie
Date: Thu Aug 14 08:37:17 2008
New Revision: 685945

URL: http://svn.apache.org/viewvc?rev=685945&view=rev
Log:
Use IN instead of looping and creating a bunch of sub-expressions.

Modified:
    ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java?rev=685945&r1=685944&r2=685945&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java Thu Aug 14 08:37:17 2008
@@ -752,26 +752,10 @@
         exprListAnd.add(expr);
 
         if (contentTypes.size() > 0) {
-            List exprListOr = FastList.newInstance();
-            Iterator it = contentTypes.iterator();
-            while (it.hasNext()) {
-                String contentType = (String) it.next();
-                expr = EntityCondition.makeCondition("contentTypeId", EntityOperator.EQUALS, contentType);
-                exprListOr.add(expr);
-            }
-            EntityConditionList contentExprList = EntityCondition.makeCondition(exprListOr, EntityOperator.OR);
-            exprListAnd.add(contentExprList);
+            exprListAnd.add(EntityCondition.makeCondition("contentTypeId", EntityOperator.IN, contentTypes));
         }
         if (assocTypes.size() > 0) {
-            List exprListOr = FastList.newInstance();
-            Iterator it = assocTypes.iterator();
-            while (it.hasNext()) {
-                String assocType = (String) it.next();
-                expr = EntityCondition.makeCondition("contentAssocTypeId", EntityOperator.EQUALS, assocType);
-                exprListOr.add(expr);
-            }
-            EntityConditionList assocExprList = EntityCondition.makeCondition(exprListOr, EntityOperator.OR);
-            exprListAnd.add(assocExprList);
+            exprListAnd.add(EntityCondition.makeCondition("contentAssocTypeId", EntityOperator.IN, assocTypes));
         }
 
         if (fromDate != null) {