-
Notifications
You must be signed in to change notification settings - Fork 103
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
[SDL-0005] Immutable RPC collections #508
[SDL-0005] Immutable RPC collections #508
Conversation
Current coverage is 9.95% (diff: 10.52%)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If sdl_enumsForName:
just does sdl_objectForName:
, should we remove that function and just use sdl_objectForName:
?
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]]; | ||
for (NSDictionary<NSString *, id> *dict in array) { | ||
[newList addObject:[[classType alloc] initWithDictionary:dict]]; | ||
} | ||
return newList; | ||
return [NSArray arrayWithArray:newList]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just do [newList copy];
instead because copy makes immutable properties.
} | ||
return newList; | ||
} | ||
- (NSArray<SDLEnum> *)sdl_enumsForName:(SDLName)name { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If sdl_enumsForName:
just does sdl_objectForName:
, should we remove that function and just use sdl_objectForName:
?
* Remove a helper method that’s not needed
@asm09fsu Ready for another review |
Fixes #507
This PR is ready for review.
Risk
This PR makes major API changes.
Testing Plan
All tests continue to pass.
Summary
This PR changes RPC properties that are currently
NSMutableArray
s to beNSArray
s instead, and updates breaking code. Note that passing a mutable array to an immutable array parameter is still valid, therefore, some code will not break for end users. However, assigning an immutable array to a mutable variable is an error, and so some code will break.Changelog
Breaking Changes
NSMutableArray
are nowNSArray
instead.