8000 This fixes issue #908 by yatsukhnenko · Pull Request #909 · phpredis/phpredis · GitHub
[go: up one dir, main page]

Skip to content

This fixes issue #908 #909

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

Merged
merged 1 commit into from
Jul 30, 2016
Merged

This fixes issue #908 #909

merged 1 commit into from
Jul 30, 2016

Conversation

yatsukhnenko
Copy link
Member

No description provided.

if ((iptr = INI_STR("redis.arrays.index")) != NULL) {
sapi_module.treat_data(PARSE_STRING, estrdup(iptr), z_params_index TSRMLS_CC);
}
if (zend_hash_find(Z_ARRVAL_P(z_params_index), name, name_len, (void **) &z_data_pp) != FAILURE) {
if(Z_TYPE_PP(z_data_pp) == IS_STRING && strncmp(Z_STRVAL_PP(z_data_pp), "1", 1) == 0) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michael-grunder, is it possible to compare single char instead of using strncmp?
Something like *Z_STRVAL_PP(z_data_pp) == '1'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that should work. That being said, I don't think this code is any kind of performance bottleneck.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, let's leave it as is. As for me it is more readable with strcmp

@michael-grunder
Copy link
Member

Hey man, this looks fine to me.

Also, you are perfectly welcome to just merge things. That's why these are develop versions of the code 😺. Don't worry, people will let us know if stuff breaks!

@yatsukhnenko yatsukhnenko merged commit 2ab9512 into phpredis:develop Jul 30, 2016
yatsukhnenko added a commit that referenced this pull request Jul 30, 2016
@yatsukhnenko yatsukhnenko deleted the issue.908 branch July 30, 2016 19:48
@yatsukhnenko
Copy link
Member Author

@michael-grunder, as I'm a newbie in php extensions development I'm not always sure of some things and what they exactly do, so I'm still need a peace of your attention to review code :)

@michael-grunder
Copy link
Member

No worries. You're pretty good in C which is really all that's required.

Basically the rest is fighting the zend api :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0