diff --git a/bin/src/modules/hook/error/mod.rs b/bin/src/modules/hook/error/mod.rs index 0563750e5..2595f64d1 100644 --- a/bin/src/modules/hook/error/mod.rs +++ b/bin/src/modules/hook/error/mod.rs @@ -10,10 +10,10 @@ pub mod bhe4_runtime_error; fn get_offset(content: &str, location: Position) -> usize { let mut offset = 0; for (i, line) in content.lines().enumerate() { - if i == location.line().expect("location should have a line number") { + if i + 1 == location.line().expect("location should have a line number") { offset += location .position() - .expect("location should have a column number"); + .expect("location should have a column number") - 1; break; } offset += line.len() + 1; diff --git a/bin/src/modules/sign.rs b/bin/src/modules/sign.rs index 70bcb0c69..d90a3c272 100644 --- a/bin/src/modules/sign.rs +++ b/bin/src/modules/sign.rs @@ -11,6 +11,7 @@ use hemtt_workspace::{ addons::Location, reporting::{Code, Diagnostic}, }; +use rayon::iter::{IntoParallelRefIterator, ParallelIterator}; use crate::{context::Context, error::Error, report::Report}; @@ -76,7 +77,7 @@ impl Module for Sign { .join("keys") .join(format!("{authority}.bikey")), )?)?; - ctx.addons().to_vec().iter().try_for_each(|addon| { + ctx.addons().to_vec().par_iter().try_for_each(|addon| { let pbo_name = addon.pbo_name(ctx.config().prefix()); let (mut pbo, sig_location, key) = match addon.location() { Location::Addons => {