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

Create transfer-array method and use it #987

Merged
merged 3 commits into from
Jun 30, 2018
Merged

Conversation

Adlai-Holler
Copy link
Member

@Adlai-Holler Adlai-Holler commented Jun 24, 2018

  • Adds a new +arrayByTransferring:count: factory method to NSArray.
    • Public version of private __CFArrayCreateTransfer function.
    • "Consumes" a C-array of strong id. Also works with vector in C++.
      • The C-array (or vector) is nilled out in the process. Consumed.
      • Removes N retain/release pairs compared to initWithObjects:count: or NSMutableArray.
      • Gives you an immutable (free-copy) array.
  • Applies this method to ASArrayByFlatMapping and layout flattening.
  • Solid unit test.

Copy link
Contributor

@maicki maicki left a comment

Choose a reason for hiding this comment

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

Nice addition to have "move" availabilities for NSArray's now.

@Adlai-Holler Adlai-Holler merged commit 77e2d28 into master Jun 30, 2018
@Adlai-Holler Adlai-Holler deleted the AHTransferArray branch June 30, 2018 01:21
mikezucc pushed a commit to mikezucc/Texture that referenced this pull request Oct 2, 2018
* Create transfer-array method and use it

* License headers

* Update ASArrayByFlatMapping
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