[php-src] PR #11889: Make DOMChildNode::remove() run in O(1) performance
| From: | nielsdos | Date: | Sat, 05 Aug 2023 20:24:11 +0000 |
| Subject: | [php-src] PR #11889: Make DOMChildNode::remove() run in O(1) performance | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-23290@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/11889
Author: nielsdos
This method had some useless logic in it. It checked whether the child node is a child of its
parent, which is always true of course. But I know where this check comes from, if you follow the
spec closely you'll find these instructions in
https://dom.spec.whatwg.org/#concept-node-remove.
That's because that algorithm is written in a generic way, where the parent and child arguments
might not come from the same subtree. However, in this particular case it *is* always the case that
the child is a child of its parent.