refactor: use as_* to avoid needless checking

This commit is contained in:
ToruNiina 2019-05-29 21:22:32 +09:00
parent 65124a8d2e
commit 4dbd2cb9fe

View File

@ -468,8 +468,7 @@ struct serializer
bool is_array_of_tables(const value& v) const
{
if(!v.is_array()) {return false;}
const auto& a = v.cast<value_t::Array>();
const auto& a = v.as_array();
return !a.empty() && a.front().is_table();
}