Skip to content

Commit 57ad667

Browse files
authored
Merge pull request #78 from pulseengine/fix/attestation-size-reduction-overflow
fix: prevent subtraction overflow in attestation size_reduction calc
2 parents bef0503 + eba8c9b commit 57ad667

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

meld-core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ impl Fuser {
772772
serde_json::json!(stats.imports_resolved),
773773
);
774774
let size_reduction = if stats.input_size > 0 {
775-
((stats.input_size - stats.output_size) as f64 / stats.input_size as f64) * 100.0
775+
((stats.input_size as f64 - stats.output_size as f64) / stats.input_size as f64) * 100.0
776776
} else {
777777
0.0
778778
};

0 commit comments

Comments
 (0)