Small optimization.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 26 May 2011 05:06:57 +0000 (07:06 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 26 May 2011 05:06:57 +0000 (07:06 +0200)
src/main/resources/static/javascript/sone.js

index 9c082f1..fbed217 100644 (file)
@@ -1709,7 +1709,7 @@ $(document).ready(function() {
                                allReplies = $(this).find(".reply");
                                if (allReplies.length > 2) {
                                        newHidden = false;
-                                       for (replyIndex = 0; replyIndex < (allReplies.length - 2); ++replyIndex) {
+                                       for (replyIndex = 0; !newHidden && (replyIndex < (allReplies.length - 2)); ++replyIndex) {
                                                $(allReplies[replyIndex]).addClass("hidden");
                                                newHidden |= $(allReplies[replyIndex]).hasClass("new");
                                        }