Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/builder/deg_builder_rna.cc
| Show First 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | |||||
| bool RNANodeQuery::contains(const char *prop_identifier, const char *rna_path_component) | bool RNANodeQuery::contains(const char *prop_identifier, const char *rna_path_component) | ||||
| { | { | ||||
| const char *substr = strstr(prop_identifier, rna_path_component); | const char *substr = strstr(prop_identifier, rna_path_component); | ||||
| if (substr == nullptr) { | if (substr == nullptr) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| // If substr != prop_identifier, it means that the substring is found further in prop_identifier, | /* If substr != prop_identifier, it means that the substring is found further in prop_identifier, | ||||
| // and that thus index -1 is a valid memory location. | * and that thus index -1 is a valid memory location. */ | ||||
| const bool start_ok = substr == prop_identifier || substr[-1] == '.'; | const bool start_ok = substr == prop_identifier || substr[-1] == '.'; | ||||
| if (!start_ok) { | if (!start_ok) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| const size_t component_len = strlen(rna_path_component); | const size_t component_len = strlen(rna_path_component); | ||||
| const bool end_ok = ELEM(substr[component_len], '\0', '.', '['); | const bool end_ok = ELEM(substr[component_len], '\0', '.', '['); | ||||
| return end_ok; | return end_ok; | ||||
| ▲ Show 20 Lines • Show All 243 Lines • Show Last 20 Lines | |||||