Skip to content

Conversation

@letFunny
Copy link
Collaborator

Syntactic sugar for adding essentials to all slices defined in the package without having to go one by one.

  • Have you signed the CLA?

Syntactic sugar for adding essentials to all slices defined in the
package without having to go one by one.
@letFunny letFunny requested a review from rebornplusplus March 11, 2024 09:45
@letFunny letFunny added the Blocked Waiting for something external label Mar 11, 2024
Copy link

@rebornplusplus rebornplusplus left a comment

Choose a reason for hiding this comment

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

Cute PR. Looks good to me, thanks.

@cjdcordeiro
Copy link
Collaborator

Nice.Thanks. This should be followed by https://warthogs.atlassian.net/browse/ROCKS-1038

@cjdcordeiro cjdcordeiro requested a review from niemeyer March 14, 2024 10:04
@cjdcordeiro cjdcordeiro added Simple Nice for a quick look on a minute or two and removed Blocked Waiting for something external labels Mar 14, 2024
Copy link
Contributor

@niemeyer niemeyer left a comment

Choose a reason for hiding this comment

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

Thanks, Alberto. A few comments:

Package: "mypkg",
Name: "essential",
Essential: []setup.SliceKey{
{"mypkg", "essential"},
Copy link
Contributor

Choose a reason for hiding this comment

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

This one is awkward. We probably don't want self-references like this? This should probably be an error if explicit, and if implicit via the package-level essentials, we should drop it from this particular slice.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed, it is now an error if a user adds the slice to the slice-level essentials. For package-level essentials, we just dont add the slice to itself.

@letFunny letFunny requested a review from niemeyer April 15, 2024 08:35
Copy link
Contributor

@niemeyer niemeyer left a comment

Choose a reason for hiding this comment

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

Thanks, Alberto. Probably the final pass.

Package string
Name string
Essential []SliceKey
Essential map[SliceKey]bool
Copy link
Contributor

Choose a reason for hiding this comment

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

This has changed since the last review, and it doesn't look natural. The de-duplication is a simple local need inside the particular algorithm that is parsing the slices. It doesn't justify changing how the whole code sees the list of essentials.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have changed it back. Instead of creating a map I am iterating over the list of essentials now. I assume the list will not be long enough to justify hashmap vs iteration over a slice, and the map requires extra allocations.

@letFunny letFunny requested a review from niemeyer April 22, 2024 10:45
Copy link
Contributor

@niemeyer niemeyer left a comment

Choose a reason for hiding this comment

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

Looks good. Just a couple of trivials.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Simple Nice for a quick look on a minute or two

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants