Revert {Structure,Union}::getField to previous behavior
This commit is contained in:
committed by
mdavidsaver
parent
caa11605fc
commit
b050fbbcbe
@@ -532,6 +532,15 @@ string Structure::getID() const
|
||||
return id;
|
||||
}
|
||||
|
||||
FieldConstPtr Structure::getField(string const & fieldName) const {
|
||||
for(size_t i=0, N=fields.size(); i<N; i++) {
|
||||
if(fieldName==fieldNames[i]) {
|
||||
return fields[i];
|
||||
}
|
||||
}
|
||||
return FieldConstPtr();
|
||||
}
|
||||
|
||||
size_t Structure::getFieldIndex(string const &fieldName) const {
|
||||
size_t numberFields = fields.size();
|
||||
for(size_t i=0; i<numberFields; i++) {
|
||||
@@ -750,6 +759,16 @@ string Union::getID() const
|
||||
return id;
|
||||
}
|
||||
|
||||
FieldConstPtr Union::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;
|
||||
}
|
||||
return FieldConstPtr();
|
||||
}
|
||||
|
||||
size_t Union::getFieldIndex(string const &fieldName) const {
|
||||
size_t numberFields = fields.size();
|
||||
for(size_t i=0; i<numberFields; i++) {
|
||||
|
||||
Reference in New Issue
Block a user