Update index vs layout_index upb docs

PiperOrigin-RevId: 690813728
pull/19024/head
Hong Shin 5 months ago committed by Copybara-Service
parent 1aff4adfc6
commit 367ef9c2ff
  1. 6
      upb/reflection/def.hpp

@ -93,9 +93,13 @@ class FieldDefPtr {
// whatever message this field belongs to. Guaranteed to be less than
// f->containing_type()->field_count(). May only be accessed once the def has
// been finalized.
// The index ordering here is *dependent* on the order of the fields in the
// .proto file.
uint32_t index() const { return upb_FieldDef_Index(ptr_); }
// Index into msgdef->layout->fields or file->exts
// Index into msgdef->layout->fields or file->exts.
// This is the index that the MiniTable uses, and is independent of the order
// of the fields in the .proto file.
uint32_t layout_index() const { return upb_FieldDef_LayoutIndex(ptr_); }
// The MessageDef to which this field belongs (for extensions, the extended

Loading…
Cancel
Save