Skip to content

ly_path_parse OPTIMIZE fail faster on invalid path#2368

Merged
michalvasko merged 1 commit intoCESNET:develfrom
irfanHaslanded:irfan/opt-union
Mar 18, 2025
Merged

ly_path_parse OPTIMIZE fail faster on invalid path#2368
michalvasko merged 1 commit intoCESNET:develfrom
irfanHaslanded:irfan/opt-union

Conversation

@irfanHaslanded
Copy link
Copy Markdown
Contributor

ly_path_parse() is called from various functions like lyplg_type_store_node_instanceid() and lyplg_type_lypath_new() with the LY_PATH_BEGIN_ABSOLUTE flag set.

This means that the path is expected to start with a '/' character. If it doesn't, this could mean that the value is not a valid path.

This can happen while finding a union type, where it is not optimal to call lyxp_expr_parse(), which is much heavier to compute.

Comment thread src/path.c Outdated
@irfanHaslanded irfanHaslanded force-pushed the irfan/opt-union branch 3 times, most recently from 84c019f to 9385d06 Compare March 18, 2025 14:11
Comment thread src/path.c Outdated
`ly_path_parse()` is called from various functions like
`lyplg_type_store_node_instanceid()` and `lyplg_type_lypath_new()` with
the `LY_PATH_BEGIN_ABSOLUTE` flag set.

This means that the path is expected to start with a '/' character.
If it doesn't, this could mean that the value is not a valid path.

This can happen while finding a union type, where it is not optimal to
call `lyxp_expr_parse()`, which is much heavier to compute.
@michalvasko michalvasko merged commit cec4188 into CESNET:devel Mar 18, 2025
11 checks passed
@irfanHaslanded irfanHaslanded deleted the irfan/opt-union branch March 18, 2025 14:41
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.

2 participants