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

Add fn ColList::last(&self) -> ColId #1267

Merged
merged 1 commit into from
May 22, 2024
Merged

Add fn ColList::last(&self) -> ColId #1267

merged 1 commit into from
May 22, 2024

Conversation

Centril
Copy link
Contributor

@Centril Centril commented May 21, 2024

Description of Changes

Adds ColList::last which is faster than list.iter().last().unwrap() thanks to

  1. not unwrapping
  2. using count leading zeros rather than doing count trailing zeros potentially 63 times.

Will be used in #1240.

API and ABI breaking changes

None

Expected complexity level and risk

2, some unsafe, but well contained.

Testing

  • proptests were amended to exercise .last().
  • miri was run on the amended test.

@Centril Centril requested review from kazimuth and Shubham8287 May 21, 2024 10:11
@Centril Centril enabled auto-merge May 21, 2024 10:53
@Centril Centril added this pull request to the merge queue May 22, 2024
Merged via the queue into master with commit 670625e May 22, 2024
8 checks passed
@Centril Centril deleted the centril/col-list-last branch May 22, 2024 19:59
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