RED-6411 - optimize method
This commit is contained in:
parent
4e76c007b8
commit
710747d00b
@ -289,14 +289,14 @@ public final class EntitySearchUtils {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isOneARecommendationAndTheOtherEntity(Entity entityOne, Entity entityTwo) {
|
||||
|
||||
private boolean isOneARecommendationAndTheOtherEntity (Entity found, Entity existing) {
|
||||
|
||||
return existing.getEntityType().equals(EntityType.RECOMMENDATION) && found.getEntityType().equals(EntityType.ENTITY) || existing.getEntityType()
|
||||
.equals(EntityType.ENTITY) && found.getEntityType().equals(EntityType.RECOMMENDATION);
|
||||
var entityTypeOne = entityOne.getEntityType();
|
||||
var entityTypeTwo = entityTwo.getEntityType();
|
||||
return entityTypeTwo.equals(EntityType.RECOMMENDATION) && entityTypeOne.equals(EntityType.ENTITY)
|
||||
|| entityTypeTwo.equals(EntityType.ENTITY) && entityTypeOne.equals(EntityType.RECOMMENDATION);
|
||||
}
|
||||
|
||||
|
||||
public void addEntitiesIgnoreRank(Set<Entity> entities, Set<Entity> found) {
|
||||
// HashSet keeps old value but we want the new.
|
||||
entities.removeAll(found);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user