[api] Decode without a vtable (#19029)

This commit is contained in:
J. Nick Koston
2026-09-24 16:14:25 +01:00
committed by GitHub
parent 9f5ac44db1
commit f8e8295088
6 changed files with 891 additions and 422 deletions
+2 -2
View File
@@ -216,7 +216,7 @@ void ProtoWriteBuffer::debug_check_encode_size_(uint32_t field_id, uint32_t expe
#endif
void ProtoDecodableMessage::decode(const uint8_t *buffer, size_t length) {
void ProtoDecodableMessage::decode_fields(void *msg, const uint8_t *buffer, size_t length, DecodeFieldFn field) {
const uint8_t *ptr = buffer;
const uint8_t *end = buffer + length;
@@ -287,7 +287,7 @@ void ProtoDecodableMessage::decode(const uint8_t *buffer, size_t length) {
return;
}
}
this->decode_field(tag, data, scalar);
field(msg, tag, data, scalar);
}
}