8000 minor #28683 Remove redundant path check (colinodell) · symfony/http-foundation@55e3db6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 55e3db6

Browse files
committed
minor #28683 Remove redundant path check (colinodell)
This PR was merged into the 2.8 branch. Discussion ---------- Remove redundant path check | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | maybe? | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commit 0ec852d79fb introduced this new method. As you can see, the code I'm removing always evaluates to `true` thanks to the first `if` statement in this method: ![image](https://user-images.githubusercontent.com/202034/46349212-70968a80-c61f-11e8-8360-7d6abc4d7414.png) (I'm not sure if redundant code technically counts as a "bug", so I've assumed "yes it does" and targeted 2.8.) Commits ------- 10795cf096 Remove redundant path check
2 parents 6f98c1c + b36e100 commit 55e3db6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ public function getRelativeUriForPath($path)
11201120
}
11211121

11221122
$sourceDirs = explode('/', isset($basePath[0]) && '/' === $basePath[0] ? substr($basePath, 1) : $basePath);
1123-
$targetDirs = explode('/', isset($path[0]) && '/' === $path[0] ? substr($path, 1) : $path);
1123+
$targetDirs = explode('/', substr($path, 1));
11241124
array_pop($sourceDirs);
11251125
$targetFile = array_pop($targetDirs);
11261126

0 commit comments

Comments
 (0)
0