Minor performance improvements

This commit is contained in:
Graham Triggs 2017-09-18 10:27:38 +01:00
parent e224736323
commit 60017600a3
9 changed files with 9 additions and 28 deletions

View file

@ -66,10 +66,7 @@ public class IndividualTypeRetryController extends BaseEditController {
continue;
}
prohibitedURIset.add(vc.getURI());
for (Iterator<String> djURIIt = vcDao.getDisjointWithClassURIs(vc.getURI()).iterator(); djURIIt.hasNext(); ) {
String djURI = djURIIt.next();
prohibitedURIset.add(djURI);
}
prohibitedURIset.addAll(vcDao.getDisjointWithClassURIs(vc.getURI()));
}
List<VClass> eligibleVClasses = new ArrayList<VClass>();

View file

@ -133,9 +133,7 @@ public class JenaAdminActions extends BaseEditController {
typeSet.add((Resource) stmt.getObject());
}
}
for (Resource classRes : ontModel.listClasses().toList()) {
typeSet.add(classRes);
}
typeSet.addAll(ontModel.listClasses().toList());
for (Resource ontClass : typeSet) {
if (!ontClass.isAnon()) { // Only query for named classes
System.out.println("Describing "+ontClass.getURI());

View file

@ -37,9 +37,7 @@ public class GetAllVClasses extends JsonObjectProducer {
VClassGroupsForRequest vcgc = VClassGroupCache.getVClassGroups(vreq);
List<VClassGroup> groups = vcgc.getGroups();
for(VClassGroup vcg: groups) {
for( VClass vc : vcg){
vclasses.add(vc);
}
vclasses.addAll(vcg);
}

View file

@ -296,9 +296,7 @@ public class EditConfigurationUtils {
/** Make a copy of list of Strings. */
public static List<String> copy(List<String> list) {
List<String> copyList = new ArrayList<String>();
for(String l: list) {
copyList.add(l);
}
copyList.addAll(list);
return copyList;
}

View file

@ -145,9 +145,7 @@ public class DefaultObjectPropertyFormGenerator implements EditConfigurationGene
if (!rangeVClass.isUnion()) {
types.add(rangeVClass);
} else {
for (VClass unionComponent : rangeVClass.getUnionComponents()) {
types.add(unionComponent);
}
types.addAll(rangeVClass.getUnionComponents());
}
return types;
} else {

View file

@ -679,9 +679,7 @@ private String getExistingIsSelfContainedTemplateQuery() {
VClassGroupsForRequest vcgc = VClassGroupCache.getVClassGroups(vreq);
List<VClassGroup> groups = vcgc.getGroups();
for(VClassGroup vcg: groups) {
for( VClass vc : vcg){
vclasses.add(vc);
}
vclasses.addAll(vcg);
}

View file

@ -207,9 +207,7 @@ public class ProcessRdfFormController extends FreemarkerHttpServlet{
public static List<String> makeListCopy(List<String> list) {
List<String> copyOfN3 = new ArrayList<String>();
for( String str : list){
copyOfN3.add(str);
}
copyOfN3.addAll(list);
return copyOfN3;
}

View file

@ -239,9 +239,7 @@ public class ABoxRecomputer {
}
}
if(rebuildModel.size() - prevRebuildSize > 0) {
for (String sameAsInd : sameAsInds) {
individualQueue.add(sameAsInd);
}
individualQueue.addAll(sameAsInds);
}
}
return additionalInferences;

View file

@ -240,9 +240,7 @@ public class OpenSocialManager {
}
}
}
for (PreparedGadget gadget : removedGadgets) {
gadgets.remove(gadget);
}
gadgets.removeAll(removedGadgets);
}
public void removeGadget(String name) {