Skip to content

Commit e107b0e

Browse files
committed
PHPC-952: Remove obsolete init argument from javascript initializers
1 parent 798ed67 commit e107b0e

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/bson.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -605,23 +605,21 @@ static bool php_phongo_bson_visit_symbol(const bson_iter_t* iter, const char* ke
605605
return false;
606606
} /* }}} */
607607

608-
static void php_phongo_bson_new_javascript_from_javascript_and_scope(int init, zval* object, const char* code, size_t code_len, const bson_t* scope TSRMLS_DC) /* {{{ */
608+
static void php_phongo_bson_new_javascript_from_javascript_and_scope(zval* object, const char* code, size_t code_len, const bson_t* scope TSRMLS_DC) /* {{{ */
609609
{
610610
php_phongo_javascript_t* intern;
611611

612-
if (init) {
613-
object_init_ex(object, php_phongo_javascript_ce);
614-
}
612+
object_init_ex(object, php_phongo_javascript_ce);
615613

616614
intern = Z_JAVASCRIPT_OBJ_P(object);
617615
intern->code = estrndup(code, code_len);
618616
intern->code_len = code_len;
619617
intern->scope = scope ? bson_copy(scope) : NULL;
620618
} /* }}} */
621619

622-
static void php_phongo_bson_new_javascript_from_javascript(int init, zval* object, const char* code, size_t code_len TSRMLS_DC) /* {{{ */
620+
static void php_phongo_bson_new_javascript_from_javascript(zval* object, const char* code, size_t code_len TSRMLS_DC) /* {{{ */
623621
{
624-
php_phongo_bson_new_javascript_from_javascript_and_scope(init, object, code, code_len, NULL TSRMLS_CC);
622+
php_phongo_bson_new_javascript_from_javascript_and_scope(object, code, code_len, NULL TSRMLS_CC);
625623
} /* }}} */
626624

627625
static bool php_phongo_bson_visit_code(const bson_iter_t* iter ARG_UNUSED, const char* key, size_t v_code_len, const char* v_code, void* data) /* {{{ */
@@ -631,7 +629,7 @@ static bool php_phongo_bson_visit_code(const bson_iter_t* iter ARG_UNUSED, const
631629
#if PHP_VERSION_ID >= 70000
632630
zval zchild;
633631

634-
php_phongo_bson_new_javascript_from_javascript(1, &zchild, v_code, v_code_len TSRMLS_CC);
632+
php_phongo_bson_new_javascript_from_javascript(&zchild, v_code, v_code_len TSRMLS_CC);
635633

636634
if (state->is_visiting_array) {
637635
add_next_index_zval(retval, &zchild);
@@ -643,7 +641,7 @@ static bool php_phongo_bson_visit_code(const bson_iter_t* iter ARG_UNUSED, const
643641
TSRMLS_FETCH();
644642

645643
MAKE_STD_ZVAL(zchild);
646-
php_phongo_bson_new_javascript_from_javascript(1, zchild, v_code, v_code_len TSRMLS_CC);
644+
php_phongo_bson_new_javascript_from_javascript(zchild, v_code, v_code_len TSRMLS_CC);
647645

648646
if (state->is_visiting_array) {
649647
add_next_index_zval(retval, zchild);
@@ -709,7 +707,7 @@ static bool php_phongo_bson_visit_codewscope(const bson_iter_t* iter ARG_UNUSED,
709707
#if PHP_VERSION_ID >= 70000
710708
zval zchild;
711709

712-
php_phongo_bson_new_javascript_from_javascript_and_scope(1, &zchild, v_code, v_code_len, v_scope TSRMLS_CC);
710+
php_phongo_bson_new_javascript_from_javascript_and_scope(&zchild, v_code, v_code_len, v_scope TSRMLS_CC);
713711

714712
if (state->is_visiting_array) {
715713
add_next_index_zval(retval, &zchild);
@@ -721,7 +719,7 @@ static bool php_phongo_bson_visit_codewscope(const bson_iter_t* iter ARG_UNUSED,
721719
TSRMLS_FETCH();
722720

723721
MAKE_STD_ZVAL(zchild);
724-
php_phongo_bson_new_javascript_from_javascript_and_scope(1, zchild, v_code, v_code_len, v_scope TSRMLS_CC);
722+
php_phongo_bson_new_javascript_from_javascript_and_scope(zchild, v_code, v_code_len, v_scope TSRMLS_CC);
725723

726724
if (state->is_visiting_array) {
727725
add_next_index_zval(retval, zchild);

0 commit comments

Comments
 (0)