diff --git a/Realm/RLMProperty.mm b/Realm/RLMProperty.mm index 540d0ee72d..8be7054614 100644 --- a/Realm/RLMProperty.mm +++ b/Realm/RLMProperty.mm @@ -140,10 +140,12 @@ - (void)updateAccessors { } static realm::util::Optional typeFromProtocolString(const char *type) { - if (strncmp(type, "RLM", 3)) { + static const char *ClassPrefix = "RLM"; + + if (strncmp(type, ClassPrefix, strlen(ClassPrefix))) { return realm::none; } - type += 3; + type += strlen(ClassPrefix); if (strcmp(type, "Int>\"") == 0) { return RLMPropertyTypeInt; }