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

Lift getting the length of the array out. #148

Merged
merged 1 commit into from Jan 25, 2018

Conversation

@jrmuizel
Copy link
Collaborator

jrmuizel commented Jan 24, 2018

This changes get() to return an Option<> and adds a get_unchecked() that doesn't do a bounds check. This means our bounds check can be inlined into the caller instead of us having to CFArrayGetCount twice for each element.


This change is Reviewable

@jdm
jdm approved these changes Jan 25, 2018
@bors-servo
Copy link
Contributor

bors-servo commented Jan 25, 2018

The latest upstream changes (presumably #147) made this pull request unmergeable. Please resolve the merge conflicts.

This changes get() to return an Option<> and adds a get_unchecked() that doesn't do a bounds check.
This means our bounds check can be inlined into the caller instead of us having to CFArrayGetCount twice
for each element.
@jrmuizel jrmuizel force-pushed the jrmuizel:bounds-check branch from 8ae4dbf to c662076 Jan 25, 2018
@jdm
Copy link
Member

jdm commented Jan 25, 2018

@bors-servo
Copy link
Contributor

bors-servo commented Jan 25, 2018

📌 Commit c662076 has been approved by jdm

bors-servo added a commit that referenced this pull request Jan 25, 2018
 Lift getting the length of the array out.

This changes get() to return an Option<> and adds a get_unchecked() that doesn't do a bounds check. This means our bounds check can be inlined into the caller instead of us having to CFArrayGetCount twice for each element.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-foundation-rs/148)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jan 25, 2018

Testing commit c662076 with merge cb463d1...

@bors-servo
Copy link
Contributor

bors-servo commented Jan 25, 2018

☀️ Test successful - status-travis
Approved by: jdm
Pushing cb463d1 to master...

@bors-servo bors-servo merged commit c662076 into servo:master Jan 25, 2018
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.