Skip to content

Commit 28ad44c

Browse files
committed
Previous break statement makes the else condition redundant
1 parent 4b484df commit 28ad44c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/bson.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,9 @@ PHONGO_API void zval_to_bson(zval *data, php_phongo_bson_flags_t flags, bson_t *
806806
}
807807

808808
break;
809-
} else if (instanceof_function(Z_OBJCE_P(data), php_phongo_type_ce TSRMLS_CC)) {
809+
}
810+
811+
if (instanceof_function(Z_OBJCE_P(data), php_phongo_type_ce TSRMLS_CC)) {
810812
phongo_throw_exception(PHONGO_ERROR_UNEXPECTED_VALUE TSRMLS_CC, "%s instance %s cannot be serialized as a root element", php_phongo_type_ce->name, Z_OBJCE_P(data)->name);
811813

812814
break;

0 commit comments

Comments
 (0)