Skip to content

Commit 97f1d87

Browse files
committed
Add unlikely
1 parent efcab54 commit 97f1d87

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sdk/pinocchio/src/cpi.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use core::{mem::MaybeUninit, ops::Deref, slice::from_raw_parts};
44

55
use crate::{
66
account_info::{AccountInfo, BorrowState},
7+
hint::unlikely,
78
instruction::{Account, Instruction, Signer},
89
program_error::ProgramError,
910
pubkey::{pubkey_eq, Pubkey},
@@ -299,7 +300,7 @@ unsafe fn inner_invoke_signed_with_bounds<const MAX_ACCOUNTS: usize>(
299300
// In order to check whether the borrow state is compatible
300301
// with the invocation, we need to check that we have the
301302
// correct account info and meta pair.
302-
if !pubkey_eq(account_info.key(), account_meta.pubkey) {
303+
if unlikely(!pubkey_eq(account_info.key(), account_meta.pubkey)) {
303304
return Err(ProgramError::InvalidArgument);
304305
}
305306

0 commit comments

Comments
 (0)