File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -1144,21 +1144,16 @@ impl<VatId> ConnectionState<VatId> {
1144
1144
}
1145
1145
1146
1146
fn answer_has_sent_return ( & self , id : AnswerId , result_exports : Vec < ExportId > ) {
1147
- let mut erase = false ;
1148
1147
let answers_slots = & mut self . answers . borrow_mut ( ) . slots ;
1149
- if let Some ( a) = answers_slots. get_mut ( & id) {
1150
- a. return_has_been_sent = true ;
1151
- if a. received_finish . get ( ) {
1152
- erase = true ;
1153
- } else {
1154
- a. result_exports = result_exports;
1155
- }
1156
- } else {
1148
+ let hash_map:: Entry :: Occupied ( mut entry) = answers_slots. entry ( id) else {
1157
1149
unreachable ! ( )
1158
- }
1159
-
1160
- if erase {
1161
- answers_slots. remove ( & id) ;
1150
+ } ;
1151
+ let a = entry. get_mut ( ) ;
1152
+ a. return_has_been_sent = true ;
1153
+ if a. received_finish . get ( ) {
1154
+ entry. remove ( ) ;
1155
+ } else {
1156
+ a. result_exports = result_exports;
1162
1157
}
1163
1158
}
1164
1159
You can’t perform that action at this time.
0 commit comments