Browse Source

Trade 2 LOC for 10.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277713 13f79535-47bb-0310-9956-ffa450edef68
master
Matthew Jason Benson 20 years ago
parent
commit
6956c66566
1 changed files with 2 additions and 10 deletions
  1. +2
    -10
      src/main/org/apache/tools/ant/taskdefs/PathConvert.java

+ 2
- 10
src/main/org/apache/tools/ant/taskdefs/PathConvert.java View File

@@ -145,16 +145,8 @@ public class PathConvert extends Task {
// If the element starts with the configured prefix, then // If the element starts with the configured prefix, then
// convert the prefix to the configured 'to' value. // convert the prefix to the configured 'to' value.


if (cmpElem.startsWith(cmpFrom)) {
int len = from.length();

if (len >= elem.length()) {
elem = to;
} else {
elem = to + elem.substring(len);
}
}
return elem;
return cmpElem.startsWith(cmpFrom)
? to + elem.substring(from.length()) : elem;
} }
} }




Loading…
Cancel
Save