Skip to content

Commit b0386da

Browse files
authored
Remove add_proto_enumdesc and get_proto_enumdesc (#6931)
1 parent 391440e commit b0386da

File tree

3 files changed

+0
-24
lines changed

3 files changed

+0
-24
lines changed

php/ext/google/protobuf/def.c

-1
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,6 @@ void register_class(void *desc, bool is_enum TSRMLS_DC) {
965965
if (is_enum) {
966966
EnumDescriptorInternal* enumdesc = desc;
967967
add_ce_enumdesc(ret, desc);
968-
add_proto_enumdesc(fullname, desc);
969968
enumdesc->klass = ret;
970969
} else {
971970
DescriptorInternal* msgdesc = desc;

php/ext/google/protobuf/protobuf.c

-21
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ static upb_inttable ce_to_enumdesc_map_persistent;
5252
// Global map from message/enum's proto fully-qualified name to corresponding
5353
// wrapper Descriptor/EnumDescriptor instances.
5454
static upb_strtable proto_to_desc_map_persistent;
55-
static upb_strtable proto_to_enumdesc_map_persistent;
5655
static upb_strtable class_to_desc_map_persistent;
5756

5857
upb_strtable reserved_names;
@@ -215,24 +214,6 @@ DescriptorInternal* get_proto_desc(const char* proto) {
215214
}
216215
}
217216

218-
void add_proto_enumdesc(const char* proto, EnumDescriptorInternal* desc) {
219-
upb_strtable_insert2(&proto_to_enumdesc_map_persistent, proto,
220-
strlen(proto), upb_value_ptr(desc));
221-
}
222-
223-
EnumDescriptorInternal* get_proto_enumdesc(const char* proto) {
224-
upb_value v;
225-
#ifndef NDEBUG
226-
v.ctype = UPB_CTYPE_PTR;
227-
#endif
228-
if (!upb_strtable_lookupptr(&proto_to_enumdesc_map_persistent,
229-
proto, strlen(proto), &v)) {
230-
return NULL;
231-
} else {
232-
return upb_value_getptr(v);
233-
}
234-
}
235-
236217
void add_class_desc(const char* klass, DescriptorInternal* desc) {
237218
upb_strtable_insert(&class_to_desc_map_persistent, klass,
238219
upb_value_ptr(desc));
@@ -378,7 +359,6 @@ static initialize_persistent_descriptor_pool(TSRMLS_D) {
378359
upb_inttable_init(&ce_to_desc_map_persistent, UPB_CTYPE_PTR);
379360
upb_inttable_init(&ce_to_enumdesc_map_persistent, UPB_CTYPE_PTR);
380361
upb_strtable_init(&proto_to_desc_map_persistent, UPB_CTYPE_PTR);
381-
upb_strtable_init(&proto_to_enumdesc_map_persistent, UPB_CTYPE_PTR);
382362
upb_strtable_init(&class_to_desc_map_persistent, UPB_CTYPE_PTR);
383363

384364
internal_descriptor_pool_impl_init(&generated_pool_impl TSRMLS_CC);
@@ -459,7 +439,6 @@ static cleanup_persistent_descriptor_pool(TSRMLS_D) {
459439
upb_inttable_uninit(&ce_to_desc_map_persistent);
460440
upb_inttable_uninit(&ce_to_enumdesc_map_persistent);
461441
upb_strtable_uninit(&proto_to_desc_map_persistent);
462-
upb_strtable_uninit(&proto_to_enumdesc_map_persistent);
463442
upb_strtable_uninit(&class_to_desc_map_persistent);
464443
}
465444

php/ext/google/protobuf/protobuf.h

-2
Original file line numberDiff line numberDiff line change
@@ -777,8 +777,6 @@ EnumDescriptorInternal* get_ce_enumdesc(const zend_class_entry* ce);
777777
// wrapper Descriptor/EnumDescriptor instances.
778778
void add_proto_desc(const char* proto, DescriptorInternal* desc);
779779
DescriptorInternal* get_proto_desc(const char* proto);
780-
void add_proto_enumdesc(const char* proto, EnumDescriptorInternal* desc);
781-
EnumDescriptorInternal* get_proto_enumdesc(const char* proto);
782780
void add_class_desc(const char* klass, DescriptorInternal* desc);
783781
DescriptorInternal* get_class_desc(const char* klass);
784782
void add_class_enumdesc(const char* klass, EnumDescriptorInternal* desc);

0 commit comments

Comments
 (0)