mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +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,
|
Align, BlockType, CodeBuilder, LocalId, ValueType, VirtualMachineSymbolState,
|
||||||
};
|
};
|
||||||
pub use linking::{LinkingSubSection, SymInfo};
|
pub use linking::{LinkingSubSection, SymInfo};
|
||||||
pub use sections::{
|
pub use sections::{ConstExpr, Export, ExportType, Global, GlobalType, Signature, WasmModule};
|
||||||
Export, ExportType, Global, ConstExpr, GlobalType, Signature, WasmModule,
|
|
||||||
};
|
|
||||||
|
|
|
@ -516,8 +516,7 @@ impl<'a> DataSection<'a> {
|
||||||
|
|
||||||
impl Serialize for DataSection<'_> {
|
impl Serialize for DataSection<'_> {
|
||||||
fn serialize<T: SerialBuffer>(&self, buffer: &mut T) {
|
fn serialize<T: SerialBuffer>(&self, buffer: &mut T) {
|
||||||
let total_payload_size = self.segments.iter().map(|seg| seg.init.len()).sum();
|
if self.segments.iter().any(|seg| !seg.init.is_empty()) {
|
||||||
if total_payload_size > 0 {
|
|
||||||
serialize_vector_section(buffer, SectionId::Data, &self.segments);
|
serialize_vector_section(buffer, SectionId::Data, &self.segments);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue