From b2a890263f4284b109b667aaa0fe341d74201aba Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Tue, 21 Jul 2009 23:28:11 -0700 Subject: Properly initialize the fqname member of upb_msg. --- src/upb_msg.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/upb_msg.c') diff --git a/src/upb_msg.c b/src/upb_msg.c index e7158f9..d44649e 100644 --- a/src/upb_msg.c +++ b/src/upb_msg.c @@ -35,7 +35,7 @@ static int compare_fields(const void *e1, const void *e2) { } bool upb_msg_init(struct upb_msg *m, struct google_protobuf_DescriptorProto *d, - bool sort) + struct upb_string fqname, bool sort) { /* TODO: more complete validation. * TODO: re-enable this check when we properly set this flag. */ @@ -47,6 +47,7 @@ bool upb_msg_init(struct upb_msg *m, struct google_protobuf_DescriptorProto *d, sizeof(struct upb_fieldsbyname_entry)); m->descriptor = d; + m->fqname = fqname; m->num_fields = d->field->len; m->set_flags_bytes = div_round_up(m->num_fields, 8); /* These are incremented in the loop. */ @@ -105,7 +106,7 @@ void upb_msg_ref(struct upb_msg *m, struct upb_msg_field *f, union upb_symbol_ref ref) { struct google_protobuf_FieldDescriptorProto *d = upb_msg_field_descriptor(f, m); - struct upb_fieldsbynum_entry *int_e = upb_inttable_lookup( + struct upb_fieldsbynum_entry *int_e = upb_inttable_fast_lookup( &m->fields_by_num, d->number, sizeof(struct upb_fieldsbynum_entry)); struct upb_fieldsbyname_entry *str_e = upb_strtable_lookup(&m->fields_by_name, d->name); -- cgit v1.2.3