Skip to content

Simplify conditions #3846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 40 commits into from
Closed

Simplify conditions #3846

wants to merge 40 commits into from

Conversation

rjhdby
Copy link

@rjhdby rjhdby commented Feb 18, 2019

Merged nested "if"s
Extracted complex checks into functions
Deduplicated some checks

Громов Андрей Олегович added 27 commits January 27, 2019 18:14
zend_compile.c: zend_is_variable(). Removed unnecessary checks. Namin…
Reorder conditions and "if else" blocks. More light and probable to top.
Join nested "if"s to parent "if" or "else" if no branching.
gmp_random() was removed
@rjhdby
Copy link
Author

rjhdby commented Feb 19, 2019

static, if ( and ) { , indent
redundant parentheses for bitwise ops
hange the second check to use fn_flags

Done

I think that it should be safe to assign these for interfaces as well.
just checking Z_TYPE(constant) == IS_NULL is sufficient.

Unnecessary checks has been removed. All test is pass.

I don't think this should be combined with the magic method checking checking code.

Splitted into two functions. Maybe make them

It should be possible to move the IS_ARRAY/IS_CALLABLE checks into the ZEND_TYPE_CODE switch below.

This comment has been hidden by github, so I noticed it after pushing last commit, sorry :)

@rjhdby
Copy link
Author

rjhdby commented Feb 22, 2019

@nikic All is done

@nikic
Copy link
Member

nikic commented Mar 6, 2019

Merged as 1be120f. Thanks!

@nikic nikic closed this Mar 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants