Optimize RefAdvertiser performance by avoiding sorting
commit36f05a9c27e6961b10df0b65014ffc869f4f8686
authorShawn O. Pearce <spearce@spearce.org>
Sat, 23 Jan 2010 02:42:12 +0000 (22 18:42 -0800)
committerShawn O. Pearce <spearce@spearce.org>
Sat, 23 Jan 2010 19:10:57 +0000 (23 11:10 -0800)
treed36d45f29665ae8ba6406c3045e6d7903bd3b81b
parent57f6f6a6bb50bf4916a32723c4f32bac616a1da6
Optimize RefAdvertiser performance by avoiding sorting

Don't copy and sort the set of references if they are passed through
in a RefMap or a SortedMap using the key's natural sort ordering.
Either map is already in the order we want to present the items
to the client in, so copying and sorting is a waste of local CPU
and memory.

Change-Id: I49ada7c1220e0fc2a163b9752c2b77525d9c82c1
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java