-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Update eos rodeos key_value.hpp and abieos module based on CDT 📦 #10889
Conversation
What is the associated abieos PR? |
See EOSIO/abieos#139 |
int32_t itr_stat = static_cast<typename iterator::status>(tbl->environment.kv_it_prev(itr, &found_key_size, &found_value_size)); | ||
return {itr, static_cast<typename iterator::status>(itr_stat), this}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need to do the same static_cast
twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modified
public: | ||
enum class status { | ||
iterator_ok = 0, // Iterator is positioned at a key-value pair | ||
iterator_erased = -1, // The key-value pair that the iterator used to be positioned at was erased | ||
iterator_end = -2, // Iterator is out-of-bounds | ||
}; | ||
|
||
iterator() = default; | ||
iterator_base() = default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to have itr == 0 && itr_stat == iterator_end
as a class invariant; i.e. whenever, you set itr
to 0, also set itr_stat
to iterator_end
. This will simplify a lot of the compare code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add is_end() method
This PR is obsolete, see #11004 |
Change Description
This PR is an add-on for previous #10864, here the change in abieos submodule is included in this PR.
eos rodeos key_value.hpp at [develop-boxed] is behind CDT version at [develop-boxed], and that key_value.hpp in CDT libraries/eosiolib/contracts/eosio/ was renamed as table.hpp in EOSIO/eosio.cdt#996 last November, so now CDT [master] and CDT [develop] does NOT have key_value.hpp any more.
Here the proposed code change is based on the latest table.hpp in CDT [develop] branch.
Change Type
Select ONE:
Testing Changes
Select ANY that apply:
Consensus Changes
API Changes
Documentation Additions