Skip to content

ly_path_parse OPTIMIZE fail faster on invalid path #2368

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

Merged
merged 1 commit into from
Mar 18, 2025

Conversation

irfanHaslanded
Copy link
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.

@irfanHaslanded irfanHaslanded force-pushed the irfan/opt-union branch 3 times, most recently from 84c019f to 9385d06 Compare March 18, 2025 14:11
`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