@@ -292,23 +292,6 @@ local.sort = function(results){
292292 return results ;
293293} ;
294294
295- // de-duplication of an array.
296-
297- local . uniques = function ( nodes , append ) {
298- var uniques = { } , i , node , uid ;
299- if ( ! append ) append = [ ] ;
300- for ( i = 0 ; node = append [ i ++ ] ; ) uniques [ this . getUID ( node ) ] = true ;
301-
302- for ( i = 0 ; node = nodes [ i ++ ] ; ) {
303- uid = this . getUID ( node ) ;
304- if ( ! uniques [ uid ] ) {
305- uniques [ uid ] = true ;
306- append . push ( node ) ;
307- }
308- }
309- return append ;
310- } ;
311-
312295local . cacheNTH = { } ;
313296
314297local . matchNTH = / ^ ( [ + - ] ? \d * ) ? ( [ a - z ] + ) ? ( [ + - ] \d + ) ? $ / ;
@@ -637,7 +620,7 @@ local.getAttribute = function(node, name){
637620local . overrides = [ ] ;
638621
639622local . override = function ( regexp , method ) {
640- local . overrides . push ( { regexp : regexp , method : method } ) ;
623+ this . overrides . push ( { regexp : regexp , method : method } ) ;
641624} ;
642625
643626local . override ( / ./ , function ( expression , found , first ) { //querySelectorAll override
@@ -655,9 +638,9 @@ local.override(/./, function(expression, found, first){ //querySelectorAll overr
655638 var i , hasOthers = ! ! ( found . length ) ;
656639
657640 if ( local . starSelectsClosedQSA ) for ( i = 0 ; node = nodes [ i ++ ] ; ) {
658- if ( node . nodeName . charCodeAt ( 0 ) != 47 && ( ! hasOthers || ! local . uniques [ node . uniqueNumber || ( node . uniqueNumber = local . uidx ++ ) ] ) ) found . push ( node ) ;
641+ if ( node . nodeName . charCodeAt ( 0 ) != 47 && ( ! hasOthers || ! local . uniques [ local . getUIDHTML ( node ) ] ) ) found . push ( node ) ;
659642 } else for ( i = 0 ; node = nodes [ i ++ ] ; ) {
660- if ( ! hasOthers || ! local . uniques [ node . uniqueNumber || ( node . uniqueNumber = local . uidx ++ ) ] ) found . push ( node ) ;
643+ if ( ! hasOthers || ! local . uniques [ local . getUIDHTML ( node ) ] ) found . push ( node ) ;
661644 }
662645
663646 if ( hasOthers ) local . sort ( found ) ;
@@ -692,7 +675,7 @@ local.override(/^\.[\w-]+$/, function(expression, found, first){ // class overri
692675 nodes = this . getElementsByClassName ( className ) ;
693676 if ( first ) return nodes [ 0 ] || null ;
694677 for ( i = 0 ; node = nodes [ i ++ ] ; ) {
695- if ( ! hasOthers || ! local . uniques [ node . uniqueNumber || ( node . uniqueNumber = local . uidx ++ ) ] ) {
678+ if ( ! hasOthers || ! local . uniques [ local . getUIDHTML ( node ) ] ) {
696679 found . push ( node ) ;
697680 }
698681 }
@@ -702,7 +685,7 @@ local.override(/^\.[\w-]+$/, function(expression, found, first){ // class overri
702685 for ( i = 0 ; node = nodes [ i ++ ] ; ) {
703686 if ( ! node . className || ! matchClass . test ( node . className ) ) continue ;
704687 if ( first ) return node ;
705- if ( ! hasOthers || ! local . uniques [ node . uniqueNumber || ( node . uniqueNumber = local . uidx ++ ) ] ) found . push ( node ) ;
688+ if ( ! hasOthers || ! local . uniques [ local . getUIDHTML ( node ) ] ) found . push ( node ) ;
706689 }
707690 }
708691 if ( hasOthers ) local . sort ( found ) ;
@@ -717,7 +700,7 @@ local.override(/^#[\w-]+$/, function(expression, found, first){ // ID override
717700 if ( local . idGetsName && el . getAttributeNode ( 'id' ) . nodeValue != id ) return false ;
718701 if ( first ) return el || null ;
719702 var hasOthers = ! ! ( found . length ) ;
720- if ( ! hasOthers || ! local . uniques [ node . uniqueNumber || ( node . uniqueNumber = local . uidx ++ ) ] ) found . push ( el ) ;
703+ if ( ! hasOthers || ! local . uniques [ local . getUIDHTML ( node ) ] ) found . push ( el ) ;
721704 if ( hasOthers ) local . sort ( found ) ;
722705 return true ;
723706} ) ;
@@ -798,6 +781,23 @@ Slick.override = function(regexp, fn){
798781 return this ;
799782} ;
800783
784+ // De-duplication of an array of HTML elements.
785+
786+ Slick . uniques = function ( nodes , append ) {
787+ var uniques = { } , i , node , uid ;
788+ if ( ! append ) append = [ ] ;
789+ for ( i = 0 ; node = append [ i ++ ] ; ) uniques [ local . getUIDHTML ( node ) ] = true ;
790+
791+ for ( i = 0 ; node = nodes [ i ++ ] ; ) {
792+ uid = local . getUIDHTML ( node ) ;
793+ if ( ! uniques [ uid ] ) {
794+ uniques [ uid ] = true ;
795+ append . push ( node ) ;
796+ }
797+ }
798+ return append ;
799+ } ;
800+
801801Slick . isXML = local . isXML ;
802802
803803// export Slick
0 commit comments