Skip to content

Commit

Permalink
Move globals to top of file
Browse files Browse the repository at this point in the history
  • Loading branch information
lionel- committed Jun 26, 2023
1 parent 9692567 commit 91612f3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/harp/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ use crate::utils::r_try_eval_silent;
use crate::vector::integer_vector::IntegerVector;
use crate::vector::Vector;

// Globals
static SESSION_INIT: Once = Once::new();
static mut NFRAME_CALL: usize = 0;

pub fn r_n_frame() -> crate::error::Result<i32> {
SESSION_INIT.call_once(init_interface);

Expand All @@ -23,10 +27,6 @@ pub fn r_n_frame() -> crate::error::Result<i32> {
}
}

// Globals
static SESSION_INIT: Once = Once::new();
static mut NFRAME_CALL: usize = 0;

fn init_interface() {
unsafe {
let nframe_call = crate::r_lang!(crate::r_symbol!("sys.nframe"));
Expand Down

0 comments on commit 91612f3

Please sign in to comment.