Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify merge translator + add test #1151

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

dexamundsen
Copy link
Contributor

@dexamundsen dexamundsen commented Jan 30, 2025

Simplify merge translator (will be used in next pr to merge other filters)
add test

@@ -74,15 +75,14 @@ public static SequencedJobSet getJobSetForEntity(
jobSet.startNewStage();

entity
.getOptimizeSearchByAttributes()
.getOptimizeSearchByAttributeNames()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename and change to set since it is better for perf (contains all function)

String filterType = filters.get(0).getClass().getName();
return filters.stream().allMatch(filter -> filter.getClass().getName().equals(filterType));
Class<?> firstClazz = filters.get(0).getClass();
return filters.stream().skip(1).allMatch(filter -> filter.getClass().equals(firstClazz));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skip 1 to avoid comparing first element to itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants