Optimize find property

This commit is contained in:
Alexander Lobas
2012-11-15 16:28:43 +04:00
parent 04b78808e2
commit e7d67c6534
@@ -524,16 +524,12 @@ public abstract class PropertyTable extends JBTable {
}
public static int findProperty(List<Property> properties, Property property) {
int index = properties.indexOf(property);
if (index != -1) {
return index;
}
String name = property.getName();
int size = properties.size();
for (int i = 0; i < size; i++) {
if (name.equals(properties.get(i).getName())) {
Property nextProperty = properties.get(i);
if (Comparing.equal(nextProperty.getGroup(), property.getGroup()) && name.equals(nextProperty.getName())) {
return i;
}
}