Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
support default type for get_kv_table_rows
Browse files Browse the repository at this point in the history
  • Loading branch information
huangminghuang committed Jan 28, 2021
1 parent b8736be commit 654a10a
Show file tree
Hide file tree
Showing 3 changed files with 249 additions and 218 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,19 @@ namespace eosio { namespace chain {
int32_t kv_it_compare(const kv_iterator& rhs) override {
EOS_ASSERT(rhs.is_kv_chainbase_context_iterator(), kv_bad_iter, "Incompatible key-value iterators");
auto& r = static_cast<const kv_iterator_chainbase&>(rhs);
if (!current && !r.current)
return 0;


EOS_ASSERT(contract == r.contract, kv_bad_iter, "Incompatible key-value iterators");
EOS_ASSERT(!current || !tracker.is_removed(*current), kv_bad_iter, "Iterator to erased element");
EOS_ASSERT(!r.current || !tracker.is_removed(*r.current), kv_bad_iter, "Iterator to erased element");
if (!current || !r.current) {
return r.current - current > 0;
if (!r.current) {
if (!current)
return 0;
else {
return -1;
}
}
if (!current) {
return 1;
}

return compare_blob(current->kv_key, r.current->kv_key);
Expand Down
Loading

0 comments on commit 654a10a

Please sign in to comment.