Remove use of struct field initial values

This commit is contained in:
Nigel Tao committed 2018-05-29 09:07:23 +10:00
1 parent 7a4f6e9e1f
commit 0e498cb86d
10 files changed
+53 -26

No files matched your search

+7 -1
View File
@@ -16,13 +16,19 @@ packageid "adl3"
// TODO: drop the '?' but still generate wuffs_adler32__hasher__initialize?
pub struct hasher?(
state base.u32 = 1,
state base.u32,
started base.bool,
)
pub func hasher.update!(x slice base.u8)(checksum base.u32) {
// The Adler-32 checksum's magic 65521 and 5552 numbers are discussed in
// RFC 1950.
if not this.started {
this.started = true
this.state = 1
}
var s1 base.u32 = this.state.low_bits(n:16)
var s2 base.u32 = this.state.high_bits(n:16)