I actually have a patch waiting to completely remove $.className and severely optimize it at the same time. I'll check out your optimizations as well, although I suspect that most of them are already covered.
--John On Tue, Aug 18, 2009 at 6:17 AM, Már Örlygsson <mar.orlygs...@gmail.com>wrote: > > It seems possible to ever so slightly optimize $.className.add(), > $.className.remove(), and $.className.has() by adding an up-front > check to see if the `className` parameter is a non-falsy value (not > just `undefined`). > > This would avoid triggering costly processing such as envoking $.each > loops, .splits() and functions, and even possibly document reflow > (when re-assigning unchanged values to an element). > > One could also check for the existence of element.className before > attempting to remove any classNames. > > It seems like a place ripe for optimization. > > -- > Már. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---