Refactor for GNUNET_memcmp

This commit is contained in:
ng0 2019-04-17 19:25:08 +00:00
parent c1d6806b57
commit 28123fd1fc
No known key found for this signature in database
GPG Key ID: E22F9BBFEE348588

View File

@ -624,13 +624,11 @@ refund_by_coin_cb (void *cls,
/* TODO: potential optimization: include these conditions /* TODO: potential optimization: include these conditions
in the SELECT! */ in the SELECT! */
if (0 != memcmp (merchant_pub, if (0 != GNUNET_memcmp (merchant_pub,
&au->merchant_pub, &au->merchant_pub))
sizeof (struct TALER_MerchantPublicKeyP)))
return GNUNET_OK; /* different merchant */ return GNUNET_OK; /* different merchant */
if (0 != memcmp (h_contract, if (0 != GNUNET_memcmp (h_contract,
au->h_contract, au->h_contract))
sizeof (struct GNUNET_HashCode)))
return GNUNET_OK; /* different contract */ return GNUNET_OK; /* different contract */
if (GNUNET_OK != if (GNUNET_OK !=
TALER_amount_subtract (&au->total_amount, TALER_amount_subtract (&au->total_amount,
@ -795,10 +793,8 @@ aggregate_cb (void *cls,
struct TALER_Amount delta; struct TALER_Amount delta;
enum GNUNET_DB_QueryStatus qs; enum GNUNET_DB_QueryStatus qs;
GNUNET_break (0 == GNUNET_break (0 == GNUNET_memcmp (&au->merchant_pub,
memcmp (&au->merchant_pub, merchant_pub));
merchant_pub,
sizeof (struct TALER_MerchantPublicKeyP)));
/* compute contribution of this coin after fees */ /* compute contribution of this coin after fees */
if (GNUNET_SYSERR == if (GNUNET_SYSERR ==
TALER_amount_subtract (&delta, TALER_amount_subtract (&delta,