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

chore: Rename LimitBuf and SortBuf #67

Closed
wants to merge 2 commits into from

Conversation

Hywan
Copy link
Collaborator

@Hywan Hywan commented Jan 10, 2025

This patch renames LimitBuf to ArrayBuf and SortBuf to VecBuf.
The idea is to identify these buffers by their intrinsic properties
(an array and a vector) instead of by their usages (inside Limit or
Sort). It makes reusability easier for new types.

Another patch adds the BUF_CAP constant to represent buffer
capacities.

Hywan added 2 commits January 10, 2025 11:30
This patch renames `LimitBuf` to `ArrayBuf` and `SortBuf` to `VecBuf`.
The idea is to identify these buffers by their intrinsic properties
(an array and a vector) instead of by their usages (inside `Limit` or
`Sort`). It makes reusability easier for new types.
This patch introduces the `BUF_CAP` constant to replace to buffer
capacities that is repeated in multiple places.
@Hywan Hywan force-pushed the chore-util-rename-buffers branch from d4a6361 to 2ca1719 Compare January 10, 2025 10:44
@Hywan Hywan requested a review from jplatte January 10, 2025 10:45
Comment on lines +45 to +46
type ArrayBuf = Option<VectorDiff<T>>;
type VecBuf = SmallVec<[VectorDiff<T>; BUF_CAP]>;
Copy link
Owner

Choose a reason for hiding this comment

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

Oh, now I remember why I didn't like this initially. These names only make sense for impl<T> VectorDiffContainerOps<T> for Vec<VectorDiff<T>>, not for impl<T> VectorDiffContainerOps<T> for VectorDiff<T>... Honestly, I'm back to strongly disliking the new names 😕

@Hywan Hywan closed this Jan 10, 2025
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