@@ -108,30 +108,30 @@ typedescription_t& DataMapSharedExt::__getitem__(const datamap_t& pDataMap, int
108108}
109109
110110typedescription_t * DataMapSharedExt::find (datamap_t * pDataMap, const char *szName)
111+ {
112+ while (pDataMap)
111113 {
112- while ( pDataMap)
114+ for ( int iCurrentIndex= 0 ; iCurrentIndex < pDataMap-> dataNumFields ; iCurrentIndex++ )
113115 {
114- for (int iCurrentIndex=0 ; iCurrentIndex < pDataMap->dataNumFields ; iCurrentIndex++)
116+ typedescription_t & pCurrentDataDesc = pDataMap->dataDesc [iCurrentIndex];
117+ if ((pCurrentDataDesc.fieldName && strcmp (szName, pCurrentDataDesc.fieldName ) == 0 ) ||
118+ (pCurrentDataDesc.externalName && strcmp (szName, pCurrentDataDesc.externalName ) == 0 ))
115119 {
116- typedescription_t & pCurrentDataDesc = pDataMap->dataDesc [iCurrentIndex];
117- if ((pCurrentDataDesc.fieldName && strcmp (szName, pCurrentDataDesc.fieldName ) == 0 ) ||
118- (pCurrentDataDesc.externalName && strcmp (szName, pCurrentDataDesc.externalName ) == 0 ))
119- {
120- return &(pDataMap->dataDesc [iCurrentIndex]);
121- }
122- else if (pCurrentDataDesc.fieldType == FIELD_EMBEDDED)
120+ return &(pDataMap->dataDesc [iCurrentIndex]);
121+ }
122+ else if (pCurrentDataDesc.fieldType == FIELD_EMBEDDED)
123+ {
124+ typedescription_t *pReturnValue = find (pCurrentDataDesc.td , szName);
125+ if (pReturnValue)
123126 {
124- typedescription_t *pReturnValue = find (pCurrentDataDesc.td , szName);
125- if (pReturnValue)
126- {
127- return pReturnValue;
128- }
127+ return pReturnValue;
129128 }
130129 }
131- pDataMap = pDataMap->baseMap ;
132130 }
133- return NULL ;
131+ pDataMap = pDataMap-> baseMap ;
134132 }
133+ return NULL ;
134+ }
135135
136136int DataMapSharedExt::find_offset (datamap_t * pDataMap, const char * name)
137137{
0 commit comments