forked from facebook/metro
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fast_path: Fix handling of inputs with indirection fragments after ot…
…her path segments Summary: Fixes an internal correctness issue where `fast_path.relative` did not return normalised paths when inputs contained indirection fragments (`./`, `../`) in any case other than a contiguous sequence after the project root. This preserves the optimised behaviour for paths like `/project/root/../../foo` (common when concatenating onto the project root), while falling back to Node for more exotic paths - `/project/root/./other/../etc`. The performance difference is negligible, and `fastPath.relative` is still about 2x faster than Node's implementation for Metro's use case (and path.relative is hot during Metro startup as well as resolution, so I do think it's worth keeping `fast_path` around). Changelog: Internal Reviewed By: huntie Differential Revision: D52365868 fbshipit-source-id: f7a1cea62113c6742612474a40ee70e5d25353cb
- Loading branch information
1 parent
cb5b17b
commit add631c
Showing
2 changed files
with
56 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters