Skip to content

Conversation

@canepat
Copy link
Member

@canepat canepat commented Jun 25, 2024

This PR contains a small refactoring in kv::api::StateCache following the move from rpc to db module made in #2136

@canepat canepat added the maintenance Some maintenance work (fix, refactor, rename, test...) label Jun 25, 2024
@canepat canepat requested review from battlmonstr and lupin012 June 25, 2024 09:42
@canepat canepat marked this pull request as ready for review June 25, 2024 10:00
bool add_code(const KeyValue& kv, CoherentStateRoot* root, StateViewId view_id);
Task<std::optional<Bytes>> get(const Bytes& key, Transaction& txn);
Task<std::optional<Bytes>> get_code(const Bytes& key, Transaction& txn);
bool add(KeyValue&& kv, CoherentStateRoot* root, StateViewId view_id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend to pass by value by default (and move at call sites), unless there's a need to disambiguate between overloads (e.g. && vs const&).

@battlmonstr battlmonstr merged commit 6e2c1e1 into master Jun 25, 2024
@battlmonstr battlmonstr deleted the db_kv_use_byte_view_state_cache branch June 25, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Some maintenance work (fix, refactor, rename, test...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants