forked from xmldom/xmldom
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: simplify
DOM.compareDocumentPosition
(xmldom#805)
PR contributes a more efficient coding for the `compareDocumentPosition` method contributed in PR xmldom#488 . In detail: * Removes the `parentChain` method and replaces it with a parent chain computation that immediately compares target nodes, thus avoiding unnecessary computations. * Uses `push` and `reverse` instead of `unshift` to assemble chains as this is considerably faster.
- Loading branch information
Showing
1 changed file
with
26 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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