Performance ECC-480: use strstr

This commit is contained in:
Shahram Najm 2017-07-04 14:47:53 +01:00
parent bcecb9faa8
commit 57e7449f09
1 changed files with 2 additions and 4 deletions

View File

@ -436,12 +436,10 @@ static grib_accessor* _grib_find_accessor(grib_handle* h, const char* name)
char* grib_split_name_attribute(grib_context* c,const char* name,char* attribute_name)
{
/*returns accessor name and attribute*/
char* p=0;
size_t size=0;
char* accessor_name=NULL;
p=(char*)name;
while ( *(p+1) != '\0' && ( *p != '-' || *(p+1)!= '>' ) ) p++;
if (*(p+1) == '\0') {
char* p = strstr(name, "->");
if (!p) {
*attribute_name=0;
return (char*)name;
}