Commit Graph

18 Commits

Author SHA1 Message Date
Martin Angers
5dccaa115b optimize winnowNodes and ClosestNodes in the same way 2016-08-28 11:55:36 -04:00
Martin Angers
26f4f54c91 simplify string search expressions, remove unused code 2016-08-28 11:09:29 -04:00
Martin Angers
6841d28c6f comment and explain the appendWithoutDuplicates logic 2016-08-27 22:29:53 -04:00
Martin Angers
7bd630023a reuse the deduplication set map in mapNodes 2016-08-27 22:25:02 -04:00
Martin Angers
c7533ba696 maintain a set of existing target nodes to deduplicate
The old implementation used nested loops to check if one of the
new nodes was already in the existing nodes. This commit
maintains a map[*html.Node]bool so that a single loop over
the new elements is required. This is slower for small
slices though, and allocates more. The next step is for
appendWithoutDuplicates to accept a map as argument so
that the set is not recreated on each call from mapNodes.
2016-08-27 18:55:21 -04:00
Martin Angers
81e6517758 doc: fix list for godoc 2016-02-02 12:40:27 -05:00
Martin Angers
b0437209ef add NodeName and OuterHtml utility functions 2016-02-02 12:28:50 -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
Dobrosław Żybort
474b169363 Update exp/html import paths 2013-02-12 20:32:16 +01:00
Martin Angers
ab7dea3da3 update to use new exp/html package 2012-09-09 18:44:47 -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
437a1dc2a1 work on filter.go, needs tests now 2012-08-30 22:47:12 -04:00
Martin Angers
de74d0bf97 reorganize code in what seems like a sane structure 2012-08-30 17:35:41 -04:00
Martin Angers
85ad689f6a add Index() methods 2012-08-30 17:24:18 -04:00
Martin Angers
2db07845a9 rework some internals, similar to jQuery 2012-08-30 14:36:36 -04:00
Martin Angers
07f9164340 start documenting, add Contains and Has 2012-08-30 12:16:33 -04:00