Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(520)

Unified Diff: java/org/chromium/distiller/DomUtil.java

Issue 1411603004: Discard hidden articles when using fast path (Closed) Base URL: https://github.com/chromium/dom-distiller.git@master
Patch Set: Comments addressed Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: java/org/chromium/distiller/DomUtil.java
diff --git a/java/org/chromium/distiller/DomUtil.java b/java/org/chromium/distiller/DomUtil.java
index d0bcb1bfd7330c1cc8c56be59fdbc6320918284f..65bc1a75b7f902c263079ea0177633619c5cd5de 100644
--- a/java/org/chromium/distiller/DomUtil.java
+++ b/java/org/chromium/distiller/DomUtil.java
@@ -171,11 +171,11 @@ public class DomUtil {
/**
* Get the nearest common ancestor of nodes.
*/
- public static Node getNearestCommonAncestor(final NodeList ns) {
- if (ns.getLength() == 0) return null;
- Node parent = ns.getItem(0);
- for (int i = 1; i < ns.getLength(); i++) {
- parent = getNearestCommonAncestor(parent, ns.getItem(i));
+ public static Node getNearestCommonAncestor(final List<Element> ns) {
+ if (ns.size() == 0) return null;
+ Node parent = ns.get(0);
+ for (int i = 1; i < ns.size(); i++) {
+ parent = getNearestCommonAncestor(parent, ns.get(i));
}
return parent;
}

Powered by Google App Engine
This is Rietveld 408576698