Skip to content

Make better use of java8 stream - #3

Merged
khorshuheng merged 1 commit into
feast-dev:masterfrom
t0t07:better-use-java8-stream
Mar 8, 2021
Merged

khorshuheng merged 1 commit into
feast-dev:masterfrom
t0t07:better-use-java8-stream

Conversation

@t0t07

@t0t07 t0t07 commented Feb 22, 2021

Copy link
Copy Markdown
Contributor

No description provided.

List<FeatureV2> sortedFeatures = new ArrayList(this.getFeatures());
List<FeatureSpecV2> sortedFeatureSpecs =
sortedFeatures.stream().map(featureV2 -> featureV2.toProto()).collect(Collectors.toList());
sortedFeatures.sort(Comparator.comparing(FeatureV2::getName));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The original code sort sortedFeatures after they have been used for generating sortedFeatureSpecs, which I don't get why.

@khorshuheng khorshuheng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

/lgtm

@khorshuheng
khorshuheng merged commit 154db09 into feast-dev:master Mar 8, 2021
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