Skip to content

Commit a1a0f3c

Browse files
committed
remove redundant logic
1 parent 0d1eab0 commit a1a0f3c

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/normalize.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ fs_drop_trailing_slash(std::string_view path)
9090
// drop trailing "/" and "\" from the path
9191
// but not if it is the root name
9292

93-
if (path.empty())
94-
return {};
95-
9693
std::string p(path);
9794

9895
while(p.length() > 1 && (p.back() == '/' || (fs_is_windows() && p.back() == '\\')))

src/parent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ std::string fs_parent(std::string_view path)
5353
return ".";
5454

5555
// need this for <filesystem> or _splitpath_s to make x: x:/
56-
if (fs_is_windows() && !p.empty() && p == fs_root_name(p))
56+
if (fs_is_windows() && p == fs_root_name(p))
5757
p.push_back('/');
5858

5959
return p;

0 commit comments

Comments
 (0)