Browse Source

Simplified use of generator.

Oskar Wrobel 9 years ago
parent
commit
8fdff60125
1 changed files with 2 additions and 3 deletions
  1. 2 3
      packages/ckeditor5-engine/tests/_utils/model.js

+ 2 - 3
packages/ckeditor5-engine/tests/_utils/model.js

@@ -406,8 +406,7 @@ function stringifyAttributeValue( data ) {
 
 // Loop trough attributes map and converts each value by passed converter.
 function *convertAttributes( attributes, converter ) {
-	for ( let attribute of attributes ) {
-		attribute[ 1 ] = converter( attribute[ 1 ] );
-		yield attribute;
+	for ( let [ key, value ] of attributes ) {
+		yield [ key, converter( value ) ];
 	}
 }