Skip to content

Commit 93ada77

Browse files
committed
refactor: cell_reader to use atoi_simd
which is not only faster than std::parse, we also don't need to use std::str::from_utf8 first before converting
1 parent 0d57803 commit 93ada77

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/xlsx/cells_reader.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,8 @@ impl<'a> XlsxCellReader<'a> {
195195
// shared index
196196
let shared_index =
197197
match get_attribute(e.attributes(), QName(b"si"))? {
198-
Some(res) => match std::str::from_utf8(res) {
199-
Ok(res) => match res.parse::<usize>() {
200-
Ok(res) => res,
201-
Err(e) => {
202-
return Err(XlsxError::ParseInt(e));
203-
}
204-
},
198+
Some(res) => match atoi_simd::parse::<usize>(res) {
199+
Ok(res) => res,
205200
Err(_) => {
206201
return Err(XlsxError::Unexpected(
207202
"si attribute must be a number",

0 commit comments

Comments
 (0)