Skip to content

Commit 47b05de

Browse files
authored
remove dead code and sillyness (#13322)
1 parent 5a76b4f commit 47b05de

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

sapi/phpdbg/phpdbg_watch.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ void phpdbg_set_addr_watchpoint(void *addr, size_t size, phpdbg_watchpoint_t *wa
350350
watch->size = size;
351351
watch->ref = NULL;
352352
watch->coll = NULL;
353-
zend_hash_init(&watch->elements, 8, brml, NULL, 0);
353+
zend_hash_init(&watch->elements, 8, NULL, NULL, 0);
354354
}
355355

356356
void phpdbg_set_zval_watchpoint(zval *zv, phpdbg_watchpoint_t *watch) {
@@ -460,7 +460,7 @@ void phpdbg_update_watch_ref(phpdbg_watchpoint_t *watch) {
460460
coll->reference.addr.ptr = NULL;
461461
}
462462

463-
zend_hash_init(&coll->parents, 8, shitty stupid parameter, NULL, 0);
463+
zend_hash_init(&coll->parents, 8, NULL, NULL, 0);
464464
zend_hash_index_add_ptr(&PHPDBG_G(watch_collisions), (zend_ulong) watch->ref, coll);
465465
}
466466
zend_hash_index_add_ptr(&coll->parents, (zend_long) watch, watch);
@@ -484,7 +484,7 @@ void phpdbg_update_watch_ref(phpdbg_watchpoint_t *watch) {
484484
phpdbg_activate_watchpoint(&coll->ref);
485485
phpdbg_watch_backup_data(&coll->ref);
486486

487-
zend_hash_init(&coll->parents, 8, shitty stupid parameter, NULL, 0);
487+
zend_hash_init(&coll->parents, 8, NULL, NULL, 0);
488488
zend_hash_index_add_ptr(&PHPDBG_G(watch_collisions), (zend_ulong) watch->ref, coll);
489489
}
490490
zend_hash_index_add_ptr(&coll->parents, (zend_long) watch, watch);
@@ -642,14 +642,13 @@ void phpdbg_recurse_watch_element(phpdbg_watch_element *element) {
642642
void phpdbg_watch_parent_ht(phpdbg_watch_element *element) {
643643
if (element->watch->type == WATCH_ON_BUCKET) {
644644
phpdbg_btree_result *res;
645-
HashPosition pos;
646645
phpdbg_watch_ht_info *hti;
647646
ZEND_ASSERT(element->parent_container);
648647
if (!(res = phpdbg_btree_find(&PHPDBG_G(watch_HashTables), (zend_ulong) element->parent_container))) {
649648
hti = emalloc(sizeof(*hti));
650649
hti->ht = element->parent_container;
651650

652-
zend_hash_init(&hti->watches, 0, grrrrr, ZVAL_PTR_DTOR, 0);
651+
zend_hash_init(&hti->watches, 0, NULL, ZVAL_PTR_DTOR, 0);
653652
phpdbg_btree_insert(&PHPDBG_G(watch_HashTables), (zend_ulong) hti->ht, hti);
654653

655654
phpdbg_set_addr_watchpoint(HT_GET_DATA_ADDR(hti->ht), HT_HASH_SIZE(hti->ht->nTableMask), &hti->hash_watch);
@@ -660,11 +659,6 @@ void phpdbg_watch_parent_ht(phpdbg_watch_element *element) {
660659
hti = (phpdbg_watch_ht_info *) res->ptr;
661660
}
662661

663-
zend_hash_internal_pointer_end_ex(hti->ht, &pos);
664-
hti->last = hti->ht->arData + pos;
665-
hti->last_str = hti->last->key;
666-
hti->last_idx = hti->last->h;
667-
668662
zend_hash_add_ptr(&hti->watches, element->name_in_parent, element);
669663
}
670664
}

sapi/phpdbg/phpdbg_watch.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,7 @@ typedef struct _phpdbg_watch_element {
106106
typedef struct {
107107
/* to watch rehashes (yes, this is not *perfect*, but good enough for everything in PHP...) */
108108
phpdbg_watchpoint_t hash_watch; /* must be first element */
109-
Bucket *last;
110-
zend_string *last_str;
111-
zend_ulong last_idx;
112-
113109
HashTable *ht;
114-
size_t data_size;
115110
HashTable watches; /* contains phpdbg_watch_element */
116111
} phpdbg_watch_ht_info;
117112

0 commit comments

Comments
 (0)