Skip to content

Commit

Permalink
Eliminate a bit of silly indirection in automaticallyNotifiesObserver…
Browse files Browse the repository at this point in the history
…sForKey

`self.sharedSchema` on an accessor class goes through an extra few steps of
trying to register it in the shared schema, discovering that it's a generated
class, and then returning the correct thing largely by coincidence. Fix this by
calling `sharedSchema` directly on the parent class.
  • Loading branch information
tgoyne committed Feb 17, 2017
1 parent 356166a commit 508ced5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Realm/RLMObjectBase.mm
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ + (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key {
const char *className = class_getName(self);
const char accessorClassPrefix[] = "RLM:Managed";
if (!strncmp(className, accessorClassPrefix, sizeof(accessorClassPrefix) - 1)) {
if (self.sharedSchema[key]) {
if ([class_getSuperclass(self.class) sharedSchema][key]) {
return NO;
}
}
Expand Down

0 comments on commit 508ced5

Please sign in to comment.