Skip to content

Commit

Permalink
chore(codegen): clippy suggested some improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwalker committed Aug 28, 2024
1 parent fe8aa70 commit e77f235
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions codegen/masm/src/masm/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -564,11 +564,10 @@ fn compute_rodata(

// Convert global variable initializers to a data segment, and place it at the computed
// global table offset in linear memory.
let extra = if globals.len() > 0 {
let extra = if !globals.is_empty() {
let size = globals.size_in_bytes();
let offset = global_table_offset;
let mut data = Vec::<u8>::with_capacity(size);
data.resize(size, 0);
let mut data = vec![0; size];
for gv in globals.iter() {
if let Some(init) = gv.initializer() {
let offset = unsafe { globals.offset_of(gv.id()) } as usize;
Expand Down

0 comments on commit e77f235

Please sign in to comment.