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

Reduce Mutables #2193

Merged
merged 2 commits into from Apr 13, 2016
Merged

Reduce Mutables #2193

merged 2 commits into from Apr 13, 2016

Conversation

pjrobertson
Copy link
Member

@pjrobertson pjrobertson commented Mar 31, 2016

As promised, a pull to reduce the use of mutable objects. First for splitObjects, then for various arrays stored for the search object view. Only the resultArray really needs to be mutable as that's what is changed as you search

@skurfer
Copy link
Member

@skurfer skurfer commented Apr 3, 2016

Merged this into my local build. I’ll try it out for a while.



// Make sure objects is immutable
objects = [objects copy];
Copy link
Member

@skurfer skurfer Apr 12, 2016

Choose a reason for hiding this comment

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

I don’t think this matters anywhere except line 196. You could just change that to

[object setObject:[objects copy] forCache:kQSObjectComponents];

and avoid making the copy in some cases. Not a big deal, though.

Copy link
Member Author

@pjrobertson pjrobertson Apr 12, 2016

Choose a reason for hiding this comment

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

I did it here in the rare case that objects might be mutated on the next line as it's being enumerated

@skurfer skurfer merged commit 8af3fb9 into master Apr 13, 2016
1 of 3 checks passed
@skurfer skurfer deleted the mutables branch Apr 13, 2016
skurfer added a commit that referenced this issue Apr 13, 2016
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.

None yet

2 participants