nervosnetwork / molecule

Another serialization system: minimalist and canonicalization.
MIT License
36 stars 23 forks source link

why has code Self::FIELD_COUNT == 0 is always false, because Self::FIELD_COUNT is const and always 3 #60

Closed sjatsh closed 1 year ago

sjatsh commented 1 year ago
image
zhangsoledad commented 1 year ago

It looks like it should be self.field_count(), @yangby-cryptape

yangby-cryptape commented 1 year ago

This piece of code is correct, but it could be optimized off in the code generator.

The condition slice_len == 4 is satisfied if and only if when the table is defined with no fields.