diff --git wp-includes/capabilities.php wp-includes/capabilities.php
index b93e2a8..69d637c 100644
--- wp-includes/capabilities.php
+++ wp-includes/capabilities.php
@@ -718,12 +718,12 @@ class WP_User {
 	 * @param string $role Role name.
 	 */
 	function set_role( $role ) {
-		foreach ( (array) $this->roles as $oldrole )
-			unset( $this->caps[$oldrole] );
-
 		if ( 1 == count( $this->roles ) && $role == $this->roles[0] )
 			return;
 
+		foreach ( (array) $this->roles as $oldrole )
+			unset( $this->caps[$oldrole] );
+
 		if ( !empty( $role ) ) {
 			$this->caps[$role] = true;
 			$this->roles = array( $role => true );
