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

Hide unsafe words base #80

Closed
oscbyspro opened this issue Apr 17, 2023 · 2 comments
Closed

Hide unsafe words base #80

oscbyspro opened this issue Apr 17, 2023 · 2 comments
Labels
addition oh, so shiny!
Milestone

Comments

@oscbyspro
Copy link
Owner

oscbyspro commented Apr 17, 2023

The unsafe words API exposes its underlying Unsafe[Mutable]Pointer<UInt> and the only reason it does this, or at the least the main reason, is so that I can call:

words.base.initialize(repeating: 0, count: words.count)

This is a bit lazy, however, and not in the spirit of keeping "[hashtag] good form [trademark]" (#79) because the initialize/update concept are not otherwise exposed (since UInt is trivial).

@oscbyspro oscbyspro added this to the v1.1.0 milestone Apr 17, 2023
@oscbyspro oscbyspro added the addition oh, so shiny! label Apr 17, 2023
@oscbyspro
Copy link
Owner Author

This does the same thing, so it's not like the convenience is worth much.

for index in words.indices {
    words[index] = 0
}

@oscbyspro
Copy link
Owner Author

oscbyspro commented Apr 17, 2023

Unrelated, but I’m not convinced _read and _modify are needed on a UInt pointer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition oh, so shiny!
Projects
None yet
Development

No branches or pull requests

1 participant