0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-16 17:08:20 +02:00

ircd:Ⓜ️:room: Optimize the state::count(void) to elide key parse, value query.

This commit is contained in:
Jason Volk 2019-07-04 01:50:23 -07:00
parent 9bff6a5b0d
commit 89e3838c4f

View file

@ -2129,7 +2129,20 @@ size_t
ircd::m::room::state::count()
const
{
return count(string_view{});
if(!present())
return count(string_view{});
const db::gopts &opts
{
this->fopts? this->fopts->gopts : db::gopts{}
};
size_t ret(0);
auto &column{dbs::room_state};
for(auto it{column.begin(room_id, opts)}; bool(it); ++it)
++ret;
return ret;
}
size_t