diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-01-16 11:24:30 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-01-16 11:24:30 +0100 |
commit | d473582634ea55c2a412da1360b05a2898ed568d (patch) | |
tree | 39ca0098ac657e5dbc0960469ae05195e2506f60 /src/datastore | |
parent | 301693904d07a063711bfc1ff4c5505c61eaf821 (diff) | |
download | gnunet-d473582634ea55c2a412da1360b05a2898ed568d.tar.gz gnunet-d473582634ea55c2a412da1360b05a2898ed568d.zip |
simplify GNUNET_CONTAINER_heap_update_cost API
Diffstat (limited to 'src/datastore')
-rw-r--r-- | src/datastore/plugin_datastore_heap.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/datastore/plugin_datastore_heap.c b/src/datastore/plugin_datastore_heap.c index 51f61764c..977d599d2 100644 --- a/src/datastore/plugin_datastore_heap.c +++ b/src/datastore/plugin_datastore_heap.c | |||
@@ -331,7 +331,7 @@ struct GetContext | |||
331 | * The plugin. | 331 | * The plugin. |
332 | */ | 332 | */ |
333 | struct Plugin *plugin; | 333 | struct Plugin *plugin; |
334 | 334 | ||
335 | /** | 335 | /** |
336 | * Requested value hash. | 336 | * Requested value hash. |
337 | */ | 337 | */ |
@@ -608,7 +608,7 @@ heap_plugin_get_expiration (void *cls, PluginDatumProcessor proc, | |||
608 | * priority should be added to the existing priority, ignoring the | 608 | * priority should be added to the existing priority, ignoring the |
609 | * priority in value. | 609 | * priority in value. |
610 | * | 610 | * |
611 | * @param cls our "struct Plugin*" | 611 | * @param cls our `struct Plugin *` |
612 | * @param uid unique identifier of the datum | 612 | * @param uid unique identifier of the datum |
613 | * @param delta by how much should the priority | 613 | * @param delta by how much should the priority |
614 | * change? If priority + delta < 0 the | 614 | * change? If priority + delta < 0 the |
@@ -628,7 +628,6 @@ heap_plugin_update (void *cls, | |||
628 | PluginUpdateCont cont, | 628 | PluginUpdateCont cont, |
629 | void *cont_cls) | 629 | void *cont_cls) |
630 | { | 630 | { |
631 | struct Plugin *plugin = cls; | ||
632 | struct Value *value; | 631 | struct Value *value; |
633 | 632 | ||
634 | value = (struct Value*) (long) uid; | 633 | value = (struct Value*) (long) uid; |
@@ -636,8 +635,7 @@ heap_plugin_update (void *cls, | |||
636 | if (value->expiration.abs_value_us != expire.abs_value_us) | 635 | if (value->expiration.abs_value_us != expire.abs_value_us) |
637 | { | 636 | { |
638 | value->expiration = expire; | 637 | value->expiration = expire; |
639 | GNUNET_CONTAINER_heap_update_cost (plugin->by_expiration, | 638 | GNUNET_CONTAINER_heap_update_cost (value->expire_heap, |
640 | value->expire_heap, | ||
641 | expire.abs_value_us); | 639 | expire.abs_value_us); |
642 | } | 640 | } |
643 | if ( (delta < 0) && (value->priority < - delta) ) | 641 | if ( (delta < 0) && (value->priority < - delta) ) |