From 36f05a9c27e6961b10df0b65014ffc869f4f8686 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Fri, 22 Jan 2010 18:42:12 -0800 Subject: 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 --- .../src/org/eclipse/jgit/http/server/InfoRefsServlet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'org.eclipse.jgit.http.server/src') 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 refs = db.getAllRefs(); refs.remove(Constants.HEAD); - adv.send(refs.values()); + adv.send(refs); return out.toString().getBytes(Constants.CHARACTER_ENCODING); } } -- cgit v1.2.3