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,
|
||||
{
|
||||
'dontLimitMoves': options['dontLimitMoves'],
|
||||
'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
|
||||
// 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();
|
||||
};
|
||||
|
||||
// Simple calculation based on Levenshtein distance.
|
||||
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 || [];
|
||||
newArray = newArray || [];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue