a little bit of cleanup and minor opt

This commit is contained in:
Michael Davidsaver committed 2018-02-06 10:02:08 -08:00
1 parent 4cca194000
commit 786575c3de
2 files changed
+13 -14

No files matched your search

+4 -5
View File
@@ -460,11 +460,10 @@ string Structure::getID() const
}
FieldConstPtr Structure::getField(string const & fieldName) const {
size_t numberFields = fields.size();
for(size_t i=0; i<numberFields; i++) {
FieldConstPtr pfield = fields[i];
int result = fieldName.compare(fieldNames[i]);
if(result==0) return pfield;
for(size_t i=0, N=fields.size(); i<N; i++) {
if(fieldName==fieldNames[i]) {
return fields[i];
}
}
return FieldConstPtr();
}