Aras Pranckevicius 9962c50b54 BLI: factor out BLI_path_has_hidden_component, fix it and speed it up
Factors out utility function "does the path contain any hidden file/folder
components?" function out of innards of UI code (edit_file,
is_hidden_dot_filename) into a BLI function BLI_path_has_hidden_component
and then:
- Adds unit test coverage to it, which uncovered some inconsistencies
- Fix the behavior inconsistencies:
  - A path component that is just a dot (.), was not considered hidden.
    Unless it was the first folder component (now this is fixed).
  - A path component that ended in a tilde (~) was considered hidden.
    Unless it was the first folder component (now this is fixed).
- Speedup the function by not doing several recursive scans over the
  string; instead all the logic is done in a single string scan.

Synthetic HasHiddenComponents_Performance test: 6.0s -> 1.1s for 50M calls
on Mac M1 Max.

More real world test (setup as in #120494): out of whole build_catalog_tree
time, the time taken by BLI_path_has_hidden_component drops from 37% down
to 28%

Pull Request: https://projects.blender.org/blender/blender/pulls/120541
2024-04-16 16:51:31 +02:00
2024-03-16 19:45:51 +01:00
2023-12-08 13:28:13 +11:00
2024-03-14 18:12:51 +01:00
2024-03-07 14:07:39 +11:00

Blender

Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.

Blender screenshot

Project Pages

Development

License

Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different, but compatible license.

See blender.org/about/license for details.

Description
No description provided
Readme 841 MiB
Languages
C++ 78%
Python 14.9%
C 2.9%
GLSL 1.9%
CMake 1.2%
Other 0.9%