]> git.cworth.org Git - sup/commitdiff
better documentation for Thread#first_useful_descendent
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Sun, 30 Dec 2007 03:11:14 +0000 (19:11 -0800)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Sun, 30 Dec 2007 05:04:56 +0000 (21:04 -0800)
lib/sup/thread.rb

index 880feb6c7c8e1a8626b2c648dede14dbc455f39d..4d92ad3dfb1efe4fab37cc41a616aeeef5052755 100644 (file)
@@ -185,6 +185,10 @@ class Container
   def root?; @parent.nil?; end
   def root; root? ? self : @parent.root; end
 
+  ## skip over any containers which are empty and have only one child. we use
+  ## this make the threaded display a little nicer, and only stick in the
+  ## "missing message" line when it's graphically necessary, i.e. when the
+  ## missing message has more than one descendent.
   def first_useful_descendant
     if empty? && @children.size == 1
       @children.first.first_useful_descendant