@@ -344,7 +344,7 @@ pub(crate) fn instrument_code(code: &PyCode, events: u32) {
344344 continue ;
345345 }
346346 // Excluded: RESUME, END_FOR, CACHE (and their instrumented variants)
347- let base = op. to_base ( ) . map_or ( op, |b| b ) ;
347+ let base = op. to_base ( ) . unwrap_or ( op) ;
348348 if matches ! (
349349 base,
350350 Instruction :: Resume { .. } | Instruction :: EndFor | Instruction :: Cache
@@ -387,7 +387,7 @@ pub(crate) fn instrument_code(code: &PyCode, events: u32) {
387387 . skip ( first_traceable)
388388 {
389389 let op = unit. op ;
390- let base = op. to_base ( ) . map_or ( op, |b| b ) ;
390+ let base = op. to_base ( ) . unwrap_or ( op) ;
391391 if matches ! ( base, Instruction :: ExtendedArg ) {
392392 continue ;
393393 }
@@ -425,7 +425,7 @@ pub(crate) fn instrument_code(code: &PyCode, events: u32) {
425425 let mut instr_idx = first_traceable;
426426 for unit in code. code . instructions [ first_traceable..len] . iter ( ) . copied ( ) {
427427 let ( op, arg) = arg_state. get ( unit) ;
428- let base = op. to_base ( ) . map_or ( op, |b| b ) ;
428+ let base = op. to_base ( ) . unwrap_or ( op) ;
429429
430430 if matches ! ( base, Instruction :: ExtendedArg ) || matches ! ( base, Instruction :: Cache ) {
431431 instr_idx += 1 ;
@@ -460,7 +460,7 @@ pub(crate) fn instrument_code(code: &PyCode, events: u32) {
460460 && !no_loc_mask. get ( target_idx) . copied ( ) . unwrap_or ( false )
461461 {
462462 let target_op = code. code . instructions [ target_idx] . op ;
463- let target_base = target_op. to_base ( ) . map_or ( target_op, |b| b ) ;
463+ let target_base = target_op. to_base ( ) . unwrap_or ( target_op) ;
464464 // Skip synthetic cleanup targets.
465465 if matches ! ( target_base, Instruction :: PopIter ) {
466466 instr_idx += 1 ;
@@ -483,7 +483,7 @@ pub(crate) fn instrument_code(code: &PyCode, events: u32) {
483483 && !no_loc_mask. get ( target_idx) . copied ( ) . unwrap_or ( false )
484484 {
485485 let target_op = code. code . instructions [ target_idx] . op ;
486- let target_base = target_op. to_base ( ) . map_or ( target_op, |b| b ) ;
486+ let target_base = target_op. to_base ( ) . unwrap_or ( target_op) ;
487487 if !matches ! ( target_base, Instruction :: PopIter )
488488 && let Some ( ( loc, _) ) = line_locations. get ( target_idx)
489489 && loc. line . get ( ) > 0
0 commit comments