diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2010-01-22 18:42:12 -0800 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2010-01-23 11:10:57 -0800 |
commit | 36f05a9c27e6961b10df0b65014ffc869f4f8686 (patch) | |
tree | d36d45f29665ae8ba6406c3045e6d7903bd3b81b /org.eclipse.jgit.http.server/src | |
parent | 57f6f6a6bb50bf4916a32723c4f32bac616a1da6 (diff) | |
download | jgit-36f05a9c27e6961b10df0b65014ffc869f4f8686.tar.gz jgit-36f05a9c27e6961b10df0b65014ffc869f4f8686.zip |
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>
Diffstat (limited to 'org.eclipse.jgit.http.server/src')
-rw-r--r-- | org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java index 3b615198a0..b766196fdc 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/InfoRefsServlet.java @@ -99,7 +99,7 @@ class InfoRefsServlet extends HttpServlet { Map<String, Ref> refs = db.getAllRefs(); refs.remove(Constants.HEAD); - adv.send(refs.values()); + adv.send(refs); return out.toString().getBytes(Constants.CHARACTER_ENCODING); } } |