aboutsummaryrefslogtreecommitdiff
path: root/src/bank-lib/fakebank_history.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-06-03 00:25:11 +0200
committerChristian Grothoff <christian@grothoff.org>2019-06-03 00:25:11 +0200
commitf7255931558bf788073af15b7e433680a10f218c (patch)
tree6e68d095eb0b2ca9a0660f594cac75ded0231d54 /src/bank-lib/fakebank_history.c
parentf2ba3508b31b2bfc5a3eb2db56600107fde6849e (diff)
eliminate useless global variable TFH_handle_history_range_step
Diffstat (limited to 'src/bank-lib/fakebank_history.c')
-rw-r--r--src/bank-lib/fakebank_history.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/bank-lib/fakebank_history.c b/src/bank-lib/fakebank_history.c
index 17960a4e5..a3553b65b 100644
--- a/src/bank-lib/fakebank_history.c
+++ b/src/bank-lib/fakebank_history.c
@@ -135,18 +135,11 @@ TFH_handle_history_range_skip (const struct HistoryArgs *ha,
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.
*
- * @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 caller_name which function is building the history.
* @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;
int ret;
- while (advance (ha,
- pos))
+ while ( (NULL != pos) &&
+ advance (ha,
+ pos) )
{
json_t *trans;
char *subject;
@@ -423,5 +417,3 @@ TFH_parse_history_common_args (struct MHD_Connection *connection,
return GNUNET_OK;
}
-
-