Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
devongovett committed Jul 3, 2022
1 parent e314547 commit 748f6b1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion parcel_sourcemap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ impl SourceMap {
}

let line = generated_line as usize;
let abs_offset = generated_line_offset.abs() as usize;
let abs_offset = generated_line_offset.unsigned_abs() as usize;
if generated_line_offset > 0 {
if line > self.inner.mapping_lines.len() {
self.ensure_lines(line + abs_offset);
Expand Down
2 changes: 1 addition & 1 deletion parcel_sourcemap/src/mapping_line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl MappingLine {
index = start_index;
}

let abs_offset = generated_column_offset.abs() as u32;
let abs_offset = generated_column_offset.unsigned_abs() as u32;
for i in index..self.mappings.len() {
let mapping = &mut self.mappings[i];
mapping.generated_column = if generated_column_offset < 0 {
Expand Down

1 comment on commit 748f6b1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parcel sourcemap benchmark

Benchmark suite Current: 748f6b1 Previous: d84c22d Ratio
consume#consume buffer 194892 ops/sec (±13%) 72015 ops/sec (±1.2e+2%) 0.37
consume#consume JS Mappings 62691 ops/sec (±7.0%) 59322 ops/sec (±5.8%) 0.95
consume#consume vlq mappings 54572 ops/sec (±12%) 55847 ops/sec (±15%) 1.02
serialize#Save buffer 413 ops/sec (±0.90%) 404 ops/sec (±0.76%) 0.98
serialize#Serialize to vlq 358 ops/sec (±1.0%) 290 ops/sec (±0.79%) 0.81
modify#negative column offset 130003 ops/sec (±19%) 155714 ops/sec (±24%) 1.20
modify#positive column offset 118063 ops/sec (±27%) 141262 ops/sec (±30%) 1.20
modify#positive line offset 50220 ops/sec (±7.3%) 48407 ops/sec (±7.8%) 0.96
modify#negative line offset 47490 ops/sec (±6.8%) 49034 ops/sec (±5.7%) 1.03
append#addSourceMap 235 ops/sec (±2.4%) 229 ops/sec (±1.5%) 0.97

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.