Index: wp-includes/theme.php
===================================================================
--- wp-includes/theme.php	(revision 15570)
+++ wp-includes/theme.php	(working copy)
@@ -469,11 +469,9 @@
  * @return array Theme roots
  */
 function get_theme_roots() {
-	$theme_roots = get_site_transient( 'theme_roots' );
-	if ( false === $theme_roots ) {
-		get_themes();
-		$theme_roots = get_site_transient( 'theme_roots' ); // this is set in get_theme()
-	}
+	while ( false === ( $theme_roots = get_site_transient( 'theme_roots' ) ) )
+		get_themes(); // update transient
+
 	return $theme_roots;
 }
 
@@ -651,17 +649,14 @@
  * @return string Theme path.
  */
 function get_theme_root( $stylesheet_or_template = false ) {
-	if ($stylesheet_or_template) {
-		$theme_roots = get_theme_roots();
-
-		if ( ! empty( $theme_roots[$stylesheet_or_template] ) )
-			$theme_root = WP_CONTENT_DIR . $theme_roots[$stylesheet_or_template];
-		else
-			$theme_root = WP_CONTENT_DIR . '/themes';
-	} else {
-		$theme_root = WP_CONTENT_DIR . '/themes';
-	}
-
+	
+	$stylesheet_or_template
+	&& ( $theme_roots = get_theme_roots() ) 
+	&& empty ( $theme_roots[$stylesheet_or_template] )
+	|| $theme_root = WP_CONTENT_DIR . $theme_roots[$stylesheet_or_template];
+	
+	empty ( $theme_root ) && $theme_root = WP_CONTENT_DIR . '/themes';
+	
 	return apply_filters( 'theme_root', $theme_root );
 }
 
