fix: diff result is error

This commit is contained in:
vran 2022-05-26 22:12:35 +08:00
parent 3b4718d5ac
commit 54c278e617
1 changed files with 3 additions and 3 deletions

View File

@ -274,9 +274,9 @@ public class DocumentService {
}
}
result.sort(Comparator.comparing(DatabaseDocumentSimpleResponse.TableData::getName));
boolean allAdded = result.stream()
.filter(item -> !item.getDiffType().isNone())
.allMatch(item -> item.getDiffType().isAdded());
var notNoneDiffs = result.stream().filter(item -> !item.getDiffType().isNone());
boolean allAdded = notNoneDiffs.count() > 0
&& notNoneDiffs.allMatch(item -> item.getDiffType().isAdded());
DiffType diffType;
if (allAdded) {
diffType = DiffType.ADDED;