oelint.vars.pathhardcode: Fix computational complexity#843
oelint.vars.pathhardcode: Fix computational complexity#843priv-kweihmann merged 2 commits intopriv-kweihmann:masterfrom
Conversation
There is no need to do have two nested loops just to check if any of the (pre, ext) combinations are in the line. One can easily search for a regex pattern which uses regex alternations. Fixes priv-kweihmann#842. Signed-off-by: Michal Sieron <michalwsieron@gmail.com>
|
@michalsieron tests are good, are you fine with the PR as well, or is there more you want to do? |
|
I think that's all. So if you are ok, with current changes, then please merge, but it seems the original issue will need to be updated and kept open. |
As it turns out, checking if searched path is present in line before we do the search with regex, can cut down time by another 50%. Signed-off-by: Michal Sieron <michalwsieron@gmail.com>
|
@priv-kweihmann I know I said I won't do anything in this PR, but after some more digging, I found something with which I may be happy to close the linked issue. With this new commit I don't really see any difference between |
There is no need to do have two nested loops just to check if any of the (pre, ext) combinations are in the line. One can easily search for a regex pattern which uses regex alternations.
Fixes #842.
Brings time to check one file (even with
RegexRpl) in use from ~18 s to 0.5 s for me.