From a105adb9cb776cb441246307306528a501a3ccce Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 29 Jun 2017 15:48:42 +0100 Subject: [PATCH] Performance ECC-480: strchr is faster --- src/grib_query.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/grib_query.c b/src/grib_query.c index 089a97963..00a6db3ac 100644 --- a/src/grib_query.c +++ b/src/grib_query.c @@ -405,11 +405,11 @@ static grib_accessor* search_and_cache(grib_handle* h, const char* name,const ch static grib_accessor* _grib_find_accessor(grib_handle* h, const char* name) { grib_accessor* a = NULL; - char* p = (char*)name; + char* p = NULL; DebugAssert(name); - while ( *p != '.' && *p != '\0' ) p++; - if ( *p == '.' ) { + p = strchr(name, '.'); + if ( p ) { int i=0,len=0; char name_space[MAX_NAMESPACE_LEN]; char* basename=NULL;