From 7481f558694af7bd849ab24b79edca56a4992744 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 31 Jul 2019 17:17:46 -0700 Subject: [PATCH] modules/m_room_bootstrap: Simplify event_id check and return. --- modules/m_room_bootstrap.cc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/modules/m_room_bootstrap.cc b/modules/m_room_bootstrap.cc index 50a6896cc..de7a0f4d8 100644 --- a/modules/m_room_bootstrap.cc +++ b/modules/m_room_bootstrap.cc @@ -762,23 +762,18 @@ try vmopts.eval = false; vmopts.user_id = user_id; vmopts.room_version = room_version; - vm::eval eval + const vm::eval eval { event, content, vmopts }; - const m::event::id::buf &ret - { - eval - }; - - if(unlikely(!ret)) + if(unlikely(!eval.event_id)) throw m::UNAVAILABLE { "Unknown error" }; - return ret; + return eval.event_id; } catch(const std::exception &e) {