Skip to content

Commit

Permalink
excel & joinp: use atoi_simd
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Nov 29, 2023
1 parent 95d8c21 commit 9521f3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cmd/excel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
args.flag_sheet
} else {
// otherwise, if --sheet is a number, its a zero-based index, fetch it
if let Ok(sheet_index) = args.flag_sheet.parse::<i32>() {
if let Ok(sheet_index) = atoi_simd::parse::<i32>(args.flag_sheet.as_bytes()) {
if sheet_index >= 0 {
if let Some(sheet_name) = sheet_names.get(sheet_index as usize) {
sheet_name.to_string()
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/joinp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,9 @@ pub fn run(argv: &[&str]) -> CliResult<()> {

if strategy == AsofStrategy::Nearest {
if let Some(ref tolerance) = args.flag_tolerance {
// If the tolerance is an integer, it is tolerance number of rows.
// If the tolerance is a positive integer, it is tolerance number of rows.
// Otherwise, it is a tolerance date language spec.
if let Ok(numeric_tolerance) = tolerance.parse::<i64>() {
if let Ok(numeric_tolerance) = atoi_simd::parse_pos(tolerance.as_bytes()) {
asof_options.tolerance = Some(AnyValue::Int64(numeric_tolerance));
} else {
asof_options.tolerance_str = Some(tolerance.into());
Expand Down

0 comments on commit 9521f3e

Please sign in to comment.