PatchSet.isRef()-optimizations.

PatchSet.isRef() is used extensively when preparing
for a ref advertisment and the regular expression used
by isRefs() is notably costly in these circumstances.

Even worse, the regular expression cannot be pre-compiled
due to lacking RegEx-support in GWT (I guess later GWT
versions introduces their own set of RegEx classes, not
sure if we want to bring them into PatchSet though).

By removing the regular expression and reimplementing
the check, we could see upto a 15% performance increase
when issuing a git ls-remote.

Change-Id: If5a39210dc084bb7cd415cfdb25387657cee2fc7
1 file changed