瀏覽代碼

Array#map changed to Array#slice because we don't need callback for elements.

Kuba Niegowski 5 年之前
父節點
當前提交
1787e7abc3
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      packages/ckeditor5-utils/src/fastdiff.js

+ 2 - 2
packages/ckeditor5-utils/src/fastdiff.js

@@ -103,11 +103,11 @@ export default function fastDiff( a, b, cmp, atomicChanges = false ) {
 	// Transform text or any iterable into arrays for easier, consistent processing.
 	// Array.from was used here but it generated incorrect results for multi-byte unicode sequences.
 	if ( !Array.isArray( a ) ) {
-		a = Array.prototype.map.call( a, c => c );
+		a = Array.prototype.slice.call( a );
 	}
 
 	if ( !Array.isArray( b ) ) {
-		b = Array.prototype.map.call( b, c => c );
+		b = Array.prototype.slice.call( b );
 	}
 
 	// Find first and last change.