DirCacheEditor: Cleanup DeleteTree constructor

Neaten up formatting and avoid strings, which prevents the need for
NLS comment tags.  Instead check the last character using char
literal, and append a char literal instead of a string.

Change-Id: Ib68e017769a1f5c03200354a805769d585a48c8b
This commit is contained in:
Shawn Pearce 2015-12-24 15:46:19 -08:00
parent 110d3ca595
commit ef757a7e12
1 changed files with 5 additions and 4 deletions

View File

@ -274,10 +274,11 @@ public static final class DeleteTree extends PathEdit {
* only the subtree's contents are matched by the command.
* The special case "" (not "/"!) deletes all entries.
*/
public DeleteTree(final String entryPath) {
super(
(entryPath.endsWith("/") || entryPath.length() == 0) ? entryPath //$NON-NLS-1$
: entryPath + "/"); //$NON-NLS-1$
public DeleteTree(String entryPath) {
super(entryPath.isEmpty()
|| entryPath.charAt(entryPath.length() - 1) == '/'
? entryPath
: entryPath + '/');
}
public void apply(final DirCacheEntry ent) {