fix subCategories

This commit is contained in:
veliymolfar 2020-05-18 17:00:05 +03:00
parent c906fcab5b
commit 0682d3b3bc

View file

@ -26,8 +26,10 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class AmenityIndexRepositoryBinary implements AmenityIndexRepository {
@ -82,14 +84,12 @@ public class AmenityIndexRepositoryBinary implements AmenityIndexRepository {
PoiCategory poiCategory = poiTypes.getPoiCategoryByName(categoryName);
List<String> deltaSubCategories = null;
for (List<String> subList : subCategories) {
for (String subCategory : subList) {
if (poiCategory.getPoiTypeByKeyName(subCategory) != null) {
if (deltaSubCategories == null) {
deltaSubCategories = new ArrayList<>();
}
deltaSubCategories.add(subCategory);
for (String subCategory : subCategories.get(i)) {
if (poiCategory.getPoiTypeByKeyName(subCategory) == null) {
if (deltaSubCategories == null) {
deltaSubCategories = new ArrayList<>();
}
deltaSubCategories.add(subCategory);
}
}
if (deltaSubCategories != null) {