Index: wp-includes/comment-template.php
===================================================================
--- wp-includes/comment-template.php	(revision 15301)
+++ wp-includes/comment-template.php	(working copy)
@@ -1320,7 +1320,7 @@
 			$add_below = 'div-comment';
 		}
 ?>
-		<<?php echo $tag ?> <?php comment_class(empty( $args['has_children'] ) ? '' : 'parent') ?> id="comment-<?php comment_ID() ?>">
+		<<?php echo $tag ?> <?php comment_class( $this->has_children ? '' : 'parent' ) ?> id="comment-<?php comment_ID() ?>">
 		<?php if ( 'div' != $args['style'] ) : ?>
 		<div id="div-comment-<?php comment_ID() ?>" class="comment-body">
 		<?php endif; ?>
Index: wp-includes/classes.php
===================================================================
--- wp-includes/classes.php	(revision 15301)
+++ wp-includes/classes.php	(working copy)
@@ -768,6 +768,15 @@
 	var $max_pages = 1;
 
 	/**
+	 * Wether the current element has children or not. To be used in start_el()
+	 *
+	 * @since 3.1.0
+	 * @var bool
+	 * @access protected
+	 */
+	var $has_children;
+
+	/**
 	 * Starts the list before the elements are added.
 	 *
 	 * Additional parameters are used in child classes. The args parameter holds
@@ -849,18 +858,20 @@
 
 		$id_field = $this->db_fields['id'];
 
+		$id = $element->$id_field;
+
 		//display this element
+		$this->has_children = !empty( $children_elements[ $id ] );
 		if ( is_array( $args[0] ) )
-			$args[0]['has_children'] = ! empty( $children_elements[$element->$id_field] );
+			$args[0]['has_children'] = $this->has_children;	// backwards compatibility
+
 		$cb_args = array_merge( array(&$output, $element, $depth), $args);
 		call_user_func_array(array(&$this, 'start_el'), $cb_args);
 
-		$id = $element->$id_field;
-
 		// descend only when the depth is right and there are childrens for this element
-		if ( ($max_depth == 0 || $max_depth > $depth+1 ) && isset( $children_elements[$id]) ) {
+		if ( ( $max_depth == 0 || $max_depth > $depth+1 ) && $this->has_children ) {
 
-			foreach( $children_elements[ $id ] as $child ){
+			foreach ( $children_elements[ $id ] as $child ) {
 
 				if ( !isset($newlevel) ) {
 					$newlevel = true;
