Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Use usize over i32 where possible #18

Closed
Tracked by #81
philpax opened this issue Mar 16, 2023 · 0 comments
Closed
Tracked by #81

Use usize over i32 where possible #18

philpax opened this issue Mar 16, 2023 · 0 comments
Assignees
Labels
issue:enhancement New feature or request meta:maintenance Changes that will make it easier for us to maintain code

Comments

@philpax
Copy link
Collaborator

philpax commented Mar 16, 2023

The original code uses int liberally due to C's wonderful integer promotion. I think it's easier for us to understand and less troublesome to index arrays if we offer a uniform usize interface across the board, and only cast to/from i32 when required.

I made this change in my take and found it to be much less messier and easier to reason about (especially with maintaining non-negativity constraints!), but I'm not sure how much it would impact the implementation here.

@philpax philpax added issue:enhancement New feature or request meta:maintenance Changes that will make it easier for us to maintain code labels Mar 24, 2023
@philpax philpax mentioned this issue Mar 26, 2023
7 tasks
@philpax philpax self-assigned this Mar 27, 2023
@philpax philpax closed this as completed in f31252a Apr 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue:enhancement New feature or request meta:maintenance Changes that will make it easier for us to maintain code
Projects
None yet
Development

No branches or pull requests

1 participant