Skip to content

Commit

Permalink
Factor context ID into caching.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadden committed Oct 2, 2020
1 parent 7064d66 commit 28abf4e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/alia/flow/content_caching.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct component_caching_data
data_block context_setup_block;
data_block content_block;
component_container_ptr container;
captured_id args_id;
captured_id content_id;
};

template<class Context, class Component, class... Args>
Expand All @@ -41,8 +41,9 @@ invoke_pure_component(Context ctx, Component&& component, Args&&... args)
{
bool content_traversal_required = container.is_dirty();

auto args_id = combine_ids(ref(args.value_id())...);
if (!data->args_id.matches(args_id))
auto content_id
= combine_ids(ref(get_content_id(ctx)), ref(args.value_id())...);
if (!data->content_id.matches(content_id))
content_traversal_required = true;

scoped_data_block context_setup(ctx, data->context_setup_block);
Expand All @@ -61,7 +62,7 @@ invoke_pure_component(Context ctx, Component&& component, Args&&... args)
});
invoker();

data->args_id.capture(args_id);
data->content_id.capture(content_id);
}
else
{
Expand Down

0 comments on commit 28abf4e

Please sign in to comment.