From ef757a7e126e059bd0afe64949440813df791de3 Mon Sep 17 00:00:00 2001 From: Shawn Pearce Date: Thu, 24 Dec 2015 15:46:19 -0800 Subject: [PATCH] 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 --- .../src/org/eclipse/jgit/dircache/DirCacheEditor.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java index aa2616044..932ef94db 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEditor.java @@ -274,10 +274,11 @@ public class DirCacheEditor extends BaseDirCacheEditor { * 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) {