Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2a5543b

Browse filesBrowse files
IlyasShabiaduh95
authored andcommitted
src: use starts_with in fs_permission.cc
PR-URL: #55811 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jason Zhang <xzha4350@gmail.com> Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
1 parent 3943986 commit 2a5543b
Copy full SHA for 2a5543b

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Open diff view settings
Collapse file

‎src/permission/fs_permission.cc‎

Copy file name to clipboardExpand all lines: src/permission/fs_permission.cc
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,16 @@ bool is_tree_granted(
5858
std::string resolved_param = node::PathResolve(env, {param});
5959
#ifdef _WIN32
6060
// Remove leading "\\?\" from UNC path
61-
if (resolved_param.substr(0, 4) == "\\\\?\\") {
61+
if (resolved_param.starts_with("\\\\?\\")) {
6262
resolved_param.erase(0, 4);
6363
}
6464

6565
// Remove leading "UNC\" from UNC path
66-
if (resolved_param.substr(0, 4) == "UNC\\") {
66+
if (resolved_param.starts_with("UNC\\")) {
6767
resolved_param.erase(0, 4);
6868
}
6969
// Remove leading "//" from UNC path
70-
if (resolved_param.substr(0, 2) == "//") {
70+
if (resolved_param.starts_with("//")) {
7171
resolved_param.erase(0, 2);
7272
}
7373
#endif

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.