File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -771,15 +771,15 @@ impl<VatId> ConnectionState<VatId> {
771771 let mut exports_to_release = Vec :: new ( ) ;
772772 let answer_id = finish. get_question_id ( ) ;
773773
774- let mut erase = false ;
775774 let answers_slots = & mut connection_state. answers . borrow_mut ( ) . slots ;
776- match answers_slots. get_mut ( & answer_id) {
777- None => {
775+ match answers_slots. entry ( answer_id) {
776+ hash_map :: Entry :: Vacant ( _ ) => {
778777 return Err ( Error :: failed ( format ! (
779778 "Invalid question ID {answer_id} in Finish message."
780779 ) ) ) ;
781780 }
782- Some ( answer) => {
781+ hash_map:: Entry :: Occupied ( mut entry) => {
782+ let answer = entry. get_mut ( ) ;
783783 answer. received_finish . set ( true ) ;
784784
785785 if finish. get_release_result_caps ( ) {
@@ -791,15 +791,11 @@ impl<VatId> ConnectionState<VatId> {
791791 answer. call_completion_promise . take ( ) ;
792792
793793 if answer. return_has_been_sent {
794- erase = true ;
794+ entry . remove ( ) ;
795795 }
796796 }
797797 }
798798
799- if erase {
800- answers_slots. remove ( & answer_id) ;
801- }
802-
803799 connection_state. release_exports ( & exports_to_release) ?;
804800 Ok ( ( ) )
805801 }
You can’t perform that action at this time.
0 commit comments