pub fn is_duplicate(
    instruction_context: &InstructionContext,
    index_in_instruction: usize,
) -> Option<usize> {
    let index_in_transaction = instruction_context.get_index_in_transaction(index_in_instruction);
    (instruction_context.get_number_of_program_accounts()..index_in_instruction).position(
        |index_in_instruction| {
            instruction_context.get_index_in_transaction(index_in_instruction)
                == index_in_transaction
        },
    )
}
/// Look for a duplicate account and return its position if found
Look for a duplicate account and return its position if found
Look for a duplicate account and return its position if found
pub fn is_duplicate(
    instruction_context: &InstructionContext,
    index_in_instruction: usize,
) -> Option<usize> {
    let index_in_transaction = instruction_context.get_index_in_transaction(index_in_instruction);
    (instruction_context.get_number_of_program_accounts()..index_in_instruction).position(
        |index_in_instruction| {
            instruction_context.get_index_in_transaction(index_in_instruction)
                == index_in_transaction
        },
    )
}
pub fn is_duplicate ( instruction_context : & InstructionContext , index_in_instruction : usize , ) -> Option < usize > { let index_in_transaction = instruction_context . get_index_in_transaction ( index_in_instruction ) ; ( instruction_context . get_number_of_program_accounts ( ) .. index_in_instruction ) . position ( | index_in_instruction | { instruction_context . get_index_in_transaction ( index_in_instruction ) == index_in_transaction } , ) }
Look for a duplicate account and return its position if found
Look for a duplicate account and return its position if found
instruction_context
&InstructionContext
index_in_instruction
usize