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>
This commit is contained in:
parent
33837e44c3
commit
34a755f1df
|
@ -600,8 +600,7 @@ private String format(AbbreviatedObjectId id) {
|
|||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue