Optimized some algorithms
Refactoring of some algorithms, which should increase the performance of at least the ::Map method significantly.
Labeled as Draft, because I didn't test the code apart from running the test cases. However, I believe the test cases don't cover these code sections, because the tests still pass, even if I manipulate the algorithms deliberately to fail.
See merge request smart-pattern/valentina!9
Very usual users have a situation where they move a pattern and measurements and place them in one folder. If path to measurements is not correct anymore but in the pattern folder we can find measurements file with the same name as expected in the broken path we will propose it by default. This change brings another case. Telegram automatically replace all spaces with underscores. Such names also must be checked and proposed.
Valentina relies on absolute paths to find path to components. In case of AppImage path will be mimicked, but root must be corrected to take into account tmp folder AppImage mounts data.
Alignment type 0 (no alignment, same as left) was incorrectly handled for layout piece. Code for the layout piece label is separate and did not handle this case. Valid value 0 was handled as right alignment.
Because Perl returns a string with a newline at the end when reading a line from a file, Perl’s regex engine matches $ at the position before the line break at the end of the string even when multi-line mode is turned off. Perl also matches $ at the very end of the string, regardless of whether that character is a line break. So ^\d+$ matches 123 whether the subject string is 123 or 123\n.
Most modern regex flavors have copied this behavior. That includes .NET, Java, PCRE, Delphi, PHP, and Python. This behavior is independent of any settings such as “multi-line mode”.
In all these flavors except Python, \Z also matches before the final line break. If you only want a match at the absolute very end of the string, use \z (lowercase z instead of uppercase Z). \A\d+\z does not match 123\n. \z matches after the line break, which is not matched by the shorthand character class.