modified compare function
This commit is contained in:
parent
0a797a692d
commit
2c7a42fadc
@ -66,13 +66,13 @@ class Utility {
|
||||
newIndex++;
|
||||
|
||||
if (oldIndex < oldWords.length && newIndex < newWords.length) {
|
||||
var nextOldWord = oldWords[oldIndex];
|
||||
var newSubIndex = newIndex;
|
||||
var oldSubIndex = oldIndex;
|
||||
while (newSubIndex < newWords.length &&
|
||||
newWords[newSubIndex].text != nextOldWord.text) {
|
||||
newWords[newSubIndex].text != oldWords[oldSubIndex].text) {
|
||||
//nextOldWord was not incremented in the loop hence used indexing for nextOldWord
|
||||
WordDelta wordDelta =
|
||||
WordDelta(old: nextOldWord, modified: newWords[newSubIndex]);
|
||||
WordDelta(old: oldWords[oldSubIndex], modified: newWords[newSubIndex]);
|
||||
delta.wordDeltas.add(wordDelta);
|
||||
newSubIndex++;
|
||||
oldSubIndex++;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user