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

feat: allow to pass a slice to the preload function #60

Merged
merged 4 commits into from
May 28, 2019

Conversation

yansal
Copy link
Contributor

@yansal yansal commented May 28, 2019

I believe it's more idiomatic for a function to take a slice as a
parameter (vs. a pointer to a slice) to indicate that this function only
mutates the values in the underlying array, and not the length or the
capacity.

For example, that's the case for the sort functions in the standard
library.

I believe it's more idiomatic for a function to take a slice as a
parameter (vs. a pointer to a slice) to indicate that this function only
mutates the values in the underlying array, and not the length or the
capacity.

For example, that's the case for the sort functions in the standard
library.
@novln
Copy link
Collaborator

novln commented May 28, 2019

I'm not sure it will work since you need to mutate the reference of the slice in case you need to resize the capacity of the underlying backing array.
See the bug we have here (#42) when we try with a struct.
Could you add some tests to ensure that this will works as intended ?

Copy link
Collaborator

@novln novln left a comment

Choose a reason for hiding this comment

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

Perfect 👍

@yansal yansal merged commit c80da74 into master May 28, 2019
@yansal yansal deleted the feat/allow-to-pass-a-slice-to-the-preload-function branch May 28, 2019 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants