Tests on equalp are always true

If `equalp` is NULL, then the function returns early, so all subsequent tests on `equalp` are not needed.
This commit is contained in:
Greg Sjaardema 2019-01-04 17:39:48 -07:00 committed by GitHub
parent 98e6384652
commit 1ab53924cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,20 +52,17 @@ NC4_inq_type_equal(int ncid1, nc_type typeid1, int ncid2,
if ((typeid1 <= NC_STRING && typeid2 > NC_STRING) ||
(typeid2 <= NC_STRING && typeid1 > NC_STRING))
{
if (equalp) *equalp = 0;
*equalp = 0;
return NC_NOERR;
}
/* If both are atomic types, the answer is easy. */
if (typeid1 <= NUM_ATOMIC_TYPES)
{
if (equalp)
{
if (typeid1 == typeid2)
*equalp = 1;
else
*equalp = 0;
}
if (typeid1 == typeid2)
*equalp = 1;
else
*equalp = 0;
return NC_NOERR;
}
@ -80,7 +77,6 @@ NC4_inq_type_equal(int ncid1, nc_type typeid1, int ncid2,
return NC_EBADTYPE;
/* Are the two types equal? */
if (equalp)
{
hid_t hid1, hid2;