diff --git a/wp-includes/rss.php b/wp-includes/rss.php
index 6d8941ab38..6371793d8b 100644
--- a/wp-includes/rss.php
+++ b/wp-includes/rss.php
@@ -338,8 +338,9 @@ class MagpieRSS {
 	function normalize () {
 		// if atom populate rss fields
 		if ( $this->is_atom() ) {
+			$atom_items = count($this->items);
 			$this->channel['description'] = $this->channel['tagline'];
-			for ( $i = 0; $i < count($this->items); $i++) {
+			for ( $i = 0; $i < $atom_items; $i++) {
 				$item = $this->items[$i];
 				if ( isset($item['summary']) )
 					$item['description'] = $item['summary'];
@@ -350,8 +351,9 @@ class MagpieRSS {
 			}
 		}
 		elseif ( $this->is_rss() ) {
+			$rss_items = count($this->items);
 			$this->channel['tagline'] = $this->channel['description'];
-			for ( $i = 0; $i < count($this->items); $i++) {
+			for ( $i = 0; $i < $rss_items; $i++) {
 				$item = $this->items[$i];
 				if ( isset($item['description']))
 					$item['summary'] = $item['description'];
