summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-11-07 17:14:02 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-11-07 17:14:02 +0000
commit1257828f0d7b7d7a39ace90de3d656cbb4b99db5 (patch)
treebabc5b265cfad790b7c3cac0df460ccdbbbd6e47
parentfe2f0b4b8fd7fa1d44ca3652b910490a501444bb (diff)
downloadlibcss-1257828f0d7b7d7a39ace90de3d656cbb4b99db5.tar.gz
libcss-1257828f0d7b7d7a39ace90de3d656cbb4b99db5.tar.bz2
Simplify cache loop criterion.
svn path=/trunk/libcss/; revision=13134
-rw-r--r--src/select/select.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/select/select.c b/src/select/select.c
index 75f920a..7baac03 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -1347,10 +1347,11 @@ css_error match_universal_combinator(css_select_ctx *ctx, css_combinator type,
(next_detail->type == CSS_SELECTOR_CLASS ||
next_detail->type == CSS_SELECTOR_ID)) {
reject_item *reject = state->next_reject + 1;
+ reject_item *last = state->reject_cache +
+ N_ELEMENTS(state->reject_cache) - 1;
bool match = false;
- while (reject < state->reject_cache +
- N_ELEMENTS(state->reject_cache)) {
+ while (reject <= last) {
/* Perform pessimistic matching (may hurt quirks) */
if (reject->type == next_detail->type &&
lwc_string_isequal(reject->value,