mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-27 07:30:33 +08:00
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:
parent
98e6384652
commit
1ab53924cb
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user