mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 07:41:12 +00:00
Fix build error
And slightly improve efficiency by exiting early from an iteration
This commit is contained in:
parent
09f2ce327c
commit
c5d99433f7
2 changed files with 2 additions and 5 deletions
|
@ -8,6 +8,4 @@ pub use code_builder::{
|
|||
Align, BlockType, CodeBuilder, LocalId, ValueType, VirtualMachineSymbolState,
|
||||
};
|
||||
pub use linking::{LinkingSubSection, SymInfo};
|
||||
pub use sections::{
|
||||
Export, ExportType, Global, ConstExpr, GlobalType, Signature, WasmModule,
|
||||
};
|
||||
pub use sections::{ConstExpr, Export, ExportType, Global, GlobalType, Signature, WasmModule};
|
||||
|
|
|
@ -516,8 +516,7 @@ impl<'a> DataSection<'a> {
|
|||
|
||||
impl Serialize for DataSection<'_> {
|
||||
fn serialize<T: SerialBuffer>(&self, buffer: &mut T) {
|
||||
let total_payload_size = self.segments.iter().map(|seg| seg.init.len()).sum();
|
||||
if total_payload_size > 0 {
|
||||
if self.segments.iter().any(|seg| !seg.init.is_empty()) {
|
||||
serialize_vector_section(buffer, SectionId::Data, &self.segments);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue