diff --git a/src/grib_accessor_class_data_apply_bitmap.cc b/src/grib_accessor_class_data_apply_bitmap.cc index 3f10fa26c..675e7b3de 100644 --- a/src/grib_accessor_class_data_apply_bitmap.cc +++ b/src/grib_accessor_class_data_apply_bitmap.cc @@ -446,7 +446,7 @@ static int get_native_type(grib_accessor* a) static int compare(grib_accessor* a, grib_accessor* b) { - int retval = 0; + int retval = GRIB_SUCCESS; double* aval = 0; double* bval = 0; @@ -475,10 +475,8 @@ static int compare(grib_accessor* a, grib_accessor* b) grib_unpack_double(b, bval, &blen); retval = GRIB_SUCCESS; - while (alen != 0) { - if (*bval != *aval) - retval = GRIB_DOUBLE_VALUE_MISMATCH; - alen--; + for (size_t i=0; icontext, aval); diff --git a/src/grib_accessor_class_long.cc b/src/grib_accessor_class_long.cc index 92431f812..e5fed8235 100644 --- a/src/grib_accessor_class_long.cc +++ b/src/grib_accessor_class_long.cc @@ -241,10 +241,8 @@ static int compare(grib_accessor* a, grib_accessor* b) grib_unpack_long(b, bval, &blen); retval = GRIB_SUCCESS; - while (alen != 0) { - if (*bval != *aval) - retval = GRIB_LONG_VALUE_MISMATCH; - alen--; + for (size_t i=0; icontext, aval); diff --git a/src/grib_accessor_class_statistics.cc b/src/grib_accessor_class_statistics.cc index a041414ee..915701a3a 100644 --- a/src/grib_accessor_class_statistics.cc +++ b/src/grib_accessor_class_statistics.cc @@ -313,10 +313,9 @@ static int compare(grib_accessor* a, grib_accessor* b) grib_unpack_double(a, aval, &alen); grib_unpack_double(b, bval, &blen); - while (alen != 0) { - if (*bval != *aval) - retval = GRIB_DOUBLE_VALUE_MISMATCH; - alen--; + retval = GRIB_SUCCESS; + for (size_t i=0; icontext, aval); diff --git a/src/grib_accessor_class_statistics_spectral.cc b/src/grib_accessor_class_statistics_spectral.cc index f545df07e..435582bef 100644 --- a/src/grib_accessor_class_statistics_spectral.cc +++ b/src/grib_accessor_class_statistics_spectral.cc @@ -266,10 +266,8 @@ static int compare(grib_accessor* a, grib_accessor* b) grib_unpack_double(b, bval, &blen); retval = GRIB_SUCCESS; - while (alen != 0) { - if (*bval != *aval) - retval = GRIB_DOUBLE_VALUE_MISMATCH; - alen--; + for (size_t i=0; icontext, aval);