ソースを参照

Remove costly quoting test in DiffFormatter

QuotedString.GIT_PATH returns the input reference exactly if
the string does not require quoting, otherwise it returns a
copy that contains the quotes on either end, plus escapes in
the middle where necessary to meet conventions.

Testing the return against '"' + name + '"' is always false,
because GIT_PATH will never return it that way.  The only way
we have quotes on either end is if there is an escape in the
middle, in which case the string isn't equal anyway.

Change-Id: I4d21d8e5c7da0d7df9792c01ce719548fa2df16b
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
tags/v0.9.1
Shawn O. Pearce 13年前
コミット
34a755f1df
1個のファイルの変更1行の追加2行の削除
  1. 1
    2
      org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java

+ 1
- 2
org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java ファイルの表示

@@ -600,8 +600,7 @@ public class DiffFormatter {
}

private static String quotePath(String name) {
String q = QuotedString.GIT_PATH.quote(name);
return ('"' + name + '"').equals(q) ? name : q;
return QuotedString.GIT_PATH.quote(name);
}

/**

読み込み中…
キャンセル
保存