Skip to content

Added recursivetreeiterator::setPostfix() method #99

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

Conversation

jaytaph
Copy link
Contributor

@jaytaph jaytaph commented Jun 2, 2012

Added a recursivetreeiterator::setPostfix method since it was not present. The getPostFix() method returns the string as set through this method, and the current() method will add the postfix to the actual current value (as stated in the documentation).

smart_str_appendl(&str, object->postfix[0].c, object->postfix[0].len);
smart_str_0(&str);

RETVAL_STRINGL(str.c, str.len, 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why can't you just return a copy of object->postfix[0].c?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this case, you could. The code is pretty much taken from the get_prefix() to make it easier to implement the same structure as the prefix in a later stage.

@lstrojny
Copy link
Contributor

@jaytaph could you copy object->postfix[0].c. Otherwise the patch looks good.

@lstrojny
Copy link
Contributor

lstrojny commented Jan 6, 2013

@jaytaph ping

@lstrojny
Copy link
Contributor

@jaytaph ping again

@jaytaph
Copy link
Contributor Author

jaytaph commented Jan 14, 2013

sorry.. extremely busy right now.. will change the patch as soon as I can find some spare time..

@php-pulls
Copy link

Comment on behalf of stas at php.net:

merged

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.

4 participants