From 410e13b40097fa6b26ce9a27f865ff258efa23b4 Mon Sep 17 00:00:00 2001 From: John Resig Date: Thu, 26 Feb 2009 01:15:54 +0000 Subject: [PATCH] As it turns out, the context was being started at a higher root than needed - fixing this speeds up > selectors. --- src/selector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/selector.js b/src/selector.js index 32817e948..e58b2571c 100644 --- a/src/selector.js +++ b/src/selector.js @@ -68,7 +68,7 @@ var Sizzle = function(selector, context, results, seed) { if ( context ) { var ret = seed ? { expr: parts.pop(), set: makeArray(seed) } : - Sizzle.find( parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context, contextXML ); + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set; if ( parts.length > 0 ) {