File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
crates/programs/world/src Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -402,7 +402,7 @@ fn apply_impl<'info>(
402402 return Err ( WorldError :: SystemNotApproved . into ( ) ) ;
403403 }
404404
405- let mut pairs = Vec :: new ( ) ;
405+ let mut pairs = Vec :: with_capacity ( remaining_accounts . len ( ) / 2 ) ;
406406 while remaining_accounts. len ( ) >= 2 {
407407 let program = remaining_accounts. remove ( 0 ) ;
408408 if program. key ( ) == ID {
@@ -425,9 +425,10 @@ fn apply_impl<'info>(
425425 key_bytes. copy_from_slice ( & data_ref[ start..start+32 ] ) ;
426426 let component_authority = Pubkey :: new_from_array ( key_bytes) ;
427427
428+ let unix_timestamp = Clock :: get ( ) ?. unix_timestamp ;
428429 if let Some ( session_token) = session_token {
429430 if component_authority == ID {
430- require ! ( Clock :: get ( ) ? . unix_timestamp < session_token. valid_until, session_keys:: SessionError :: InvalidToken ) ;
431+ require ! ( unix_timestamp < session_token. valid_until, session_keys:: SessionError :: InvalidToken ) ;
431432 } else {
432433 let validity_ctx = session_keys:: ValidityChecker {
433434 session_token : session_token. clone ( ) ,
You can’t perform that action at this time.
0 commit comments