File tree Expand file tree Collapse file tree 1 file changed +11
-12
lines changed
beacon_node/lighthouse_network/src/service Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -250,18 +250,17 @@ impl futures::stream::Stream for GossipCache {
250250 Poll :: Ready ( Some ( expired) ) => {
251251 let expected_key = expired. key ( ) ;
252252 let ( topic, data) = expired. into_inner ( ) ;
253- match self . topic_msgs . get_mut ( & topic) {
254- Some ( msgs) => {
255- let key = msgs. remove ( & data) ;
256- debug_assert_eq ! ( key, Some ( expected_key) ) ;
257- if msgs. is_empty ( ) {
258- // no more messages for this topic.
259- self . topic_msgs . remove ( & topic) ;
260- }
261- }
262- None => {
263- #[ cfg( debug_assertions) ]
264- panic ! ( "Topic for registered message is not present." )
253+ let topic_msg = self . topic_msgs . get_mut ( & topic) ;
254+ debug_assert ! (
255+ topic_msg. is_none( ) ,
256+ "Topic for registered message is not present."
257+ ) ;
258+ if let Some ( msgs) = topic_msg {
259+ let key = msgs. remove ( & data) ;
260+ debug_assert_eq ! ( key, Some ( expected_key) ) ;
261+ if msgs. is_empty ( ) {
262+ // no more messages for this topic.
263+ self . topic_msgs . remove ( & topic) ;
265264 }
266265 }
267266 Poll :: Ready ( Some ( Ok ( topic) ) )
You can’t perform that action at this time.
0 commit comments