Skip to content

Commit 2cefb4e

Browse files
committed
Use non-duplicate constant
1 parent 7ce89d5 commit 2cefb4e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

p-token/src/entrypoint.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ use {
66
},
77
pinocchio::{
88
account_info::AccountInfo,
9-
entrypoint::deserialize,
9+
entrypoint::{deserialize, NON_DUP_MARKER},
10+
hint::likely,
1011
log::sol_log,
1112
no_allocator, nostd_panic_handler,
1213
program_error::{ProgramError, ToStr},
@@ -15,7 +16,6 @@ use {
1516
pinocchio_token_interface::{
1617
error::TokenError,
1718
instruction::TokenInstruction,
18-
likely,
1919
state::{account::Account, mint::Mint, Transmutable},
2020
},
2121
};
@@ -115,11 +115,11 @@ pub unsafe extern "C" fn entrypoint(input: *mut u8) -> u64 {
115115
// and discriminator equal to 12.
116116
if *input == 4
117117
&& (*input.add(ACCOUNT1_DATA_LEN).cast::<u64>() == Account::LEN as u64)
118-
&& (*input.add(ACCOUNT2_HEADER_OFFSET) == 255)
118+
&& (*input.add(ACCOUNT2_HEADER_OFFSET) == NON_DUP_MARKER)
119119
&& (*input.add(ACCOUNT2_DATA_LEN).cast::<u64>() == Mint::LEN as u64)
120-
&& (*input.add(IX12_ACCOUNT3_HEADER_OFFSET) == 255)
120+
&& (*input.add(IX12_ACCOUNT3_HEADER_OFFSET) == NON_DUP_MARKER)
121121
&& (*input.add(IX12_ACCOUNT3_DATA_LEN).cast::<u64>() == Account::LEN as u64)
122-
&& (*input.add(IX12_ACCOUNT4_HEADER_OFFSET) == 255)
122+
&& (*input.add(IX12_ACCOUNT4_HEADER_OFFSET) == NON_DUP_MARKER)
123123
{
124124
// The `authority` account can have variable data length.
125125
let account_4_data_len_aligned =
@@ -170,9 +170,9 @@ pub unsafe extern "C" fn entrypoint(input: *mut u8) -> u64 {
170170
// and discriminator equal to 3.
171171
else if *input == 3
172172
&& (*input.add(ACCOUNT1_DATA_LEN).cast::<u64>() == Account::LEN as u64)
173-
&& (*input.add(ACCOUNT2_HEADER_OFFSET) == 255)
173+
&& (*input.add(ACCOUNT2_HEADER_OFFSET) == NON_DUP_MARKER)
174174
&& (*input.add(ACCOUNT2_DATA_LEN).cast::<u64>() == Account::LEN as u64)
175-
&& (*input.add(IX3_ACCOUNT3_HEADER_OFFSET) == 255)
175+
&& (*input.add(IX3_ACCOUNT3_HEADER_OFFSET) == NON_DUP_MARKER)
176176
{
177177
// The `authority` account can have variable data length.
178178
let account_3_data_len_aligned =

0 commit comments

Comments
 (0)