fuwaneko / node-protobuf

Google Protocol Buffers wrapper for Node.js [UNMAINTAINED]
181 stars 42 forks source link

avoid parsing and allocating memory for unset optional fields #74

Closed InfinitiesLoop closed 8 years ago

InfinitiesLoop commented 8 years ago

When the field is optional and the parsed protobuf Message does not have the field, there's no need to parse it into a v8 object. This just moves that check before the work is done.