jvoisin
5f0afd53e4
perf: replace Index() PrevAll traversal with direct sibling walk
...
Index() was creating a Selection, calling PrevAll() which traversed
through getSiblingNodes -> mapNodes (allocating a dedup map and
intermediate slices), then calling Length() on the result.
This commit replaces this with a direct PrevSibling pointer walk that counts
element nodes, bringing the number of allocations down to zero instead of a
couple of hundreds on local benchmarks
2026-05-23 22:50:53 +02:00
Martin Angers
520f19d599
add ToEnd marker to Slice until the end of the Selection
2018-01-28 14:41:06 -05:00
Martin Angers
fb2312a925
add final *Matcher* overloads
2014-11-07 12:19:01 -05:00
Martin Angers
251095afb5
start adding matcher functions
2014-11-06 21:43:08 -05:00
Martin Angers
040cf98281
change paths to golang.org/x/, fails to build because cascadia has to switch too
2014-11-05 20:30:33 -05:00
Martin Angers
2c6687f6d3
lint
2014-04-11 12:00:17 -04:00
tnt
076667ebf2
Updated docs for First() and Last()
2014-02-28 21:55:18 +01:00
tnt
48de68c2b7
Eq now returns an empty Selector when an invalid index is given
2014-02-28 21:54:48 +01:00
Dobrosław Żybort
474b169363
Update exp/html import paths
2013-02-12 20:32:16 +01:00
Martin Angers
b26e04175c
fix comment in Slice(), negative indices are now supported
2012-11-15 17:15:47 -05:00
Martin Angers
6669ef001f
remove Document.Root, Document is itself a Selection (using embedded struct)
2012-10-14 12:28:27 -04:00
Martin Angers
cbddb7a808
add support for negative indices in Slice(), with tests
2012-10-10 19:55:34 -04:00
Martin Angers
2d885ccd3a
add tests for End() rollbacks, doc
2012-09-05 09:35:53 -04:00
Martin Angers
6e1e76af6b
refactor Document to make Root a Selection, with all API available
2012-09-02 14:45:50 -04:00
Martin Angers
f1e54e5311
add Add() and AndSelf(), with tests
2012-08-31 10:27:45 -04:00
Martin Angers
85ad689f6a
add Index() methods
2012-08-30 17:24:18 -04:00
Martin Angers
fe36d7039a
add Get() to array.go, with tests
2012-08-30 15:52:41 -04:00
Martin Angers
5608755eb5
reorganize positional methods in array.go, tests.
2012-08-30 15:42:36 -04:00