File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -2216,9 +2216,8 @@ diff_match_patch.prototype.patch_splitMax = function(patches) {
22162216} ;
22172217
22182218diff_match_patch . prototype . diffs_joinSurrogatePairs = function ( diffs ) {
2219- var newDiffs = [ ] ;
2220-
22212219 var lastEnd ;
2220+ var overwrittenDiffsCounter = 0 ;
22222221
22232222 for ( var x = 0 ; x < diffs . length ; x ++ ) {
22242223 var thisDiff = diffs [ x ] ;
@@ -2244,10 +2243,11 @@ diff_match_patch.prototype.diffs_joinSurrogatePairs = function(diffs) {
22442243 continue ;
22452244 }
22462245
2247- newDiffs . push ( thisDiff )
2246+ diffs [ overwrittenDiffsCounter ] = thisDiff ;
2247+ overwrittenDiffsCounter ++ ;
22482248 }
22492249
2250- return newDiffs
2250+ return diffs . splice ( 0 , overwrittenDiffsCounter )
22512251}
22522252
22532253diff_match_patch . prototype . patch_joinSurrogatePairs = function ( patch ) {
You can’t perform that action at this time.
0 commit comments