EOS Table 倒序删除
数据库中只保留最新的100条记录,旧纪录删除
// 最多100条
besthistory_tables besthistory_table(_self, _self.value);
total_count = 0;
auto itr_besthistory = besthistory_table.rbegin();
while(itr_besthistory != besthistory_table.rend()){
if(total_count >= 99){
auto itr = besthistory_table.erase(--itr_besthistory.base());
itr_besthistory = std::reverse_iterator(itr);
} else {
total_count++;
itr_besthistory++;
}
}