mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-25 10:09:20 +03:00
KnockoutJS drop unused dontLimitMoves
This commit is contained in:
parent
acf1be454f
commit
62bda28a28
2 changed files with 1 additions and 5 deletions
|
|
@ -87,7 +87,6 @@
|
||||||
Array.prototype.map.call(lastMappingResult, x => x.arrayEntry),
|
Array.prototype.map.call(lastMappingResult, x => x.arrayEntry),
|
||||||
array,
|
array,
|
||||||
{
|
{
|
||||||
'dontLimitMoves': options['dontLimitMoves'],
|
|
||||||
'sparse': true
|
'sparse': true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -78,16 +78,13 @@ ko.utils.compareArrays = (() => {
|
||||||
|
|
||||||
// Set a limit on the number of consecutive non-matching comparisons; having it a multiple of
|
// Set a limit on the number of consecutive non-matching comparisons; having it a multiple of
|
||||||
// smlIndexMax keeps the time complexity of this algorithm linear.
|
// smlIndexMax keeps the time complexity of this algorithm linear.
|
||||||
ko.utils.findMovesInArrayComparison(notInBig, notInSml, !options['dontLimitMoves'] && smlIndexMax * 10);
|
ko.utils.findMovesInArrayComparison(notInBig, notInSml, smlIndexMax * 10);
|
||||||
|
|
||||||
return editScript.reverse();
|
return editScript.reverse();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Simple calculation based on Levenshtein distance.
|
// Simple calculation based on Levenshtein distance.
|
||||||
return (oldArray, newArray, options) => {
|
return (oldArray, newArray, options) => {
|
||||||
// For backward compatibility, if the third arg is actually a bool, interpret
|
|
||||||
// it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }.
|
|
||||||
options = (typeof options === 'boolean') ? { 'dontLimitMoves': options } : (options || {});
|
|
||||||
oldArray = oldArray || [];
|
oldArray = oldArray || [];
|
||||||
newArray = newArray || [];
|
newArray = newArray || [];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue