-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Implement iteration cache, item cache and length cache for node list iteration #11330
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
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
0ff0ee3
Implement iteration cache, item cache and length cache for node list …
nielsdos 02c0761
Use match any for ns too (note: contains bugfix for which I'll create…
nielsdos ff807d6
Update comment
nielsdos a75c85a
Comments
nielsdos dccd29c
Fix staleness check
nielsdos 737f8be
Fix SimpleXML invalidations
nielsdos 3e1eadf
Move common code, update internals upgrading note with the new functions
nielsdos 6ca41b7
Add DOMDocument::xinclude() test for liveness
nielsdos 57215ac
More invalidations
nielsdos 8e614b3
Fix tree traversal and add some tests
nielsdos 652c73a
Fixup extensions section
nielsdos 4b69269
nodep == NULL is impossible here
nielsdos 7ea0e02
Get rid of index == -1 condition
nielsdos c33dcd8
Improve test
nielsdos 85da7e9
Add NULL check for detached document case
nielsdos 39bee8b
Avoid allocations and rely on interned strings if possible
nielsdos efb4f45
Throw an exception instead
nielsdos 8cba455
[ci skip] NEWS
nielsdos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -511,7 +511,6 @@ PHP_METHOD(DOMElement, getElementsByTagName) | |
size_t name_len; | ||
dom_object *intern, *namednode; | ||
char *name; | ||
xmlChar *local; | ||
|
||
id = ZEND_THIS; | ||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) { | ||
|
@@ -522,8 +521,7 @@ PHP_METHOD(DOMElement, getElementsByTagName) | |
|
||
php_dom_create_iterator(return_value, DOM_NODELIST); | ||
namednode = Z_DOMOBJ_P(return_value); | ||
local = xmlCharStrndup(name, name_len); | ||
dom_namednode_iter(intern, 0, namednode, NULL, local, NULL); | ||
dom_namednode_iter(intern, 0, namednode, NULL, name, name_len, NULL, 0); | ||
} | ||
/* }}} end dom_element_get_elements_by_tag_name */ | ||
|
||
|
@@ -930,7 +928,6 @@ PHP_METHOD(DOMElement, getElementsByTagNameNS) | |
size_t uri_len, name_len; | ||
dom_object *intern, *namednode; | ||
char *uri, *name; | ||
xmlChar *local, *nsuri; | ||
|
||
id = ZEND_THIS; | ||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!s", &uri, &uri_len, &name, &name_len) == FAILURE) { | ||
|
@@ -941,9 +938,7 @@ PHP_METHOD(DOMElement, getElementsByTagNameNS) | |
|
||
php_dom_create_iterator(return_value, DOM_NODELIST); | ||
namednode = Z_DOMOBJ_P(return_value); | ||
local = xmlCharStrndup(name, name_len); | ||
nsuri = xmlCharStrndup(uri ? uri : "", uri_len); | ||
dom_namednode_iter(intern, 0, namednode, NULL, local, nsuri); | ||
dom_namednode_iter(intern, 0, namednode, NULL, name, name_len, uri ? uri : "", uri_len); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto uri_len comment |
||
|
||
} | ||
/* }}} end dom_element_get_elements_by_tag_name_ns */ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't uri_len potentially undefined here? Or does ZPP set the value to 0 even if the uri pointer is set to NULL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uri_len will be 0 if uri is not provided. Check out
zend_parse_arg_string()
: If the string is NULL then the length gets set to 0.