eliminate useless global variable TFH_handle_history_range_step

This commit is contained in:
Christian Grothoff 2019-06-03 00:25:11 +02:00
parent f2ba3508b3
commit f725593155
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
3 changed files with 5 additions and 21 deletions

View File

@ -755,7 +755,6 @@ handle_history_range (struct TALER_FAKEBANK_Handle *h,
hrd.end.abs_value_us = end_stamp * 1000LL * 1000LL; hrd.end.abs_value_us = end_stamp * 1000LL * 1000LL;
ha.range = &hrd; ha.range = &hrd;
pos = NULL;
/* hunt for 'pos' in the Transaction(s) LL. */ /* hunt for 'pos' in the Transaction(s) LL. */
for (pos = h->transactions_head; for (pos = h->transactions_head;
NULL != pos; NULL != pos;
@ -768,7 +767,7 @@ handle_history_range (struct TALER_FAKEBANK_Handle *h,
pos, pos,
&ha, &ha,
&TFH_handle_history_range_skip, &TFH_handle_history_range_skip,
TFH_handle_history_range_step, &TFH_handle_history_range_skip,
&TFH_handle_history_range_advance); &TFH_handle_history_range_advance);
} }

View File

@ -312,11 +312,4 @@ struct Transaction *
TFH_handle_history_range_skip (const struct HistoryArgs *ha, TFH_handle_history_range_skip (const struct HistoryArgs *ha,
const struct Transaction *pos); const struct Transaction *pos);
/**
* Iterates on the "next" element to be processed. To
* be used when the current element _gets_ inserted in the result.
* Same implementation of the "skip" counterpart, as /history-range
* does not have the notion of count/delta.
*/
Step TFH_handle_history_range_step;
#endif #endif

View File

@ -135,18 +135,11 @@ TFH_handle_history_range_skip (const struct HistoryArgs *ha,
return pos->next; return pos->next;
} }
/**
* Iterates on the "next" element to be processed. To
* be used when the current element _gets_ inserted in the result.
* Same implementation of the "skip" counterpart, as /history-range
* does not have the notion of count/delta.
*/
Step TFH_handle_history_range_step = &TFH_handle_history_range_skip;
/** /**
* Actual history response builder. * Actual history response builder.
* *
* @param pos first (included) element in the result set. * @param pos first (included) element in the result set, NULL if history is empty
* @param ha history arguments. * @param ha history arguments.
* @param caller_name which function is building the history. * @param caller_name which function is building the history.
* @return MHD_YES / MHD_NO, after having enqueued the response * @return MHD_YES / MHD_NO, after having enqueued the response
@ -168,8 +161,9 @@ TFH_build_history_response (struct MHD_Connection *connection,
json_t *jresponse; json_t *jresponse;
int ret; int ret;
while (advance (ha, while ( (NULL != pos) &&
pos)) advance (ha,
pos) )
{ {
json_t *trans; json_t *trans;
char *subject; char *subject;
@ -423,5 +417,3 @@ TFH_parse_history_common_args (struct MHD_Connection *connection,
return GNUNET_OK; return GNUNET_OK;
} }