hemanthboyina commented on a change in pull request #3217:
URL: https://github.com/apache/hadoop/pull/3217#discussion_r681451588
##########
File path:
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Path.java
##########
@@ -199,8 +199,15 @@ public Path(String pathString) throws
IllegalArgumentException {
int start = 0;
// parse uri scheme, if any
- int colon = pathString.indexOf(':');
- int slash = pathString.indexOf('/');
+ int colon = -1;
+ int slash = -1;
+ if (StringUtils.countMatches(pathString, ":") > 2) {
+ colon = pathString.indexOf(":/");
Review comment:
Looks "slash = pathString.indexOf('/')" line is common in both If Else
loops, can we bring this line out of If Else ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]