Skip to content

Commit f5c5113

Browse files
committed
default common List
1 parent ab3da37 commit f5c5113

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/src/diff.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,22 +213,24 @@ List<commonOrDifferentThing> diff_comm(List<String> file1, List<String> file2) {
213213
int tail1 = file1.length;
214214
int tail2 = file2.length;
215215

216-
commonOrDifferentThing common = new commonOrDifferentThing()..common =
217-
new List<String>();
216+
commonOrDifferentThing common = new commonOrDifferentThing();
217+
common.common = new List<String>();
218218

219219
void processCommon() {
220220
if (common.common.length > 0) {
221221
common.common = common.common.reversed.toList();
222222
result.add(common);
223-
common = new commonOrDifferentThing()..common = new List<String>();
223+
common = new commonOrDifferentThing();
224+
common.common = new List<String>();
224225
}
225226
}
226227

227228
for (CandidateThing candidate = longest_common_subsequence(file1, file2);
228229
candidate != null; candidate = candidate.chain) {
229230
commonOrDifferentThing different = new commonOrDifferentThing()
230231
..file1 = new List<String>()
231-
..file2 = new List<String>();
232+
..file2 = new List<String>()
233+
..common = new List<String>();
232234

233235
while (--tail1 > candidate.file1index) {
234236
different.file1.add(file1[tail1]);

0 commit comments

Comments
 (0)