From ed807ce4235bb17a55e6314317abe2222c4b56df Mon Sep 17 00:00:00 2001
From: Jason Volk <jason@zemos.net>
Date: Tue, 28 Apr 2020 03:29:50 -0700
Subject: [PATCH] modules/client/sync/rooms/state: Hoist conditional branch to
 polylog phased.

---
 modules/client/sync/rooms/state.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/client/sync/rooms/state.cc b/modules/client/sync/rooms/state.cc
index 55c006857..bfa7b6d02 100644
--- a/modules/client/sync/rooms/state.cc
+++ b/modules/client/sync/rooms/state.cc
@@ -243,6 +243,9 @@ ircd::m::sync::_room_state_polylog(data &data)
 			if(!apropos(data, data.room_head))
 				return false;
 
+	if(data.phased && data.range.first == 0)
+		return room_state_phased_events(data);
+
 	return room_state_polylog_events(data);
 }
 
@@ -264,9 +267,6 @@ ircd::m::sync::crazyload_historical_members
 bool
 ircd::m::sync::room_state_polylog_events(data &data)
 {
-	if(data.phased && data.range.first == 0)
-		return room_state_phased_events(data);
-
 	bool ret{false};
 	ctx::mutex mutex;
 	json::stack::array array