diff cmdline/org/tmatesoft/hg/console/Status.java @ 279:23e3ea855097

Use EnumMap when keys are from enumeration
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 31 Aug 2011 23:22:18 +0200
parents d5268ca7715b
children 45dc79e545f5
line wrap: on
line diff
--- a/cmdline/org/tmatesoft/hg/console/Status.java	Mon Aug 29 23:31:37 2011 +0200
+++ b/cmdline/org/tmatesoft/hg/console/Status.java	Wed Aug 31 23:22:18 2011 +0200
@@ -20,11 +20,11 @@
 
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.EnumMap;
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
-import java.util.TreeMap;
 
 import org.tmatesoft.hg.core.HgRepoFacade;
 import org.tmatesoft.hg.core.HgStatus;
@@ -65,7 +65,7 @@
 		final boolean showCopies = cmdLineOpts.getBoolean("-C", "--copies");
 		class StatusHandler implements HgStatusCommand.Handler {
 			
-			final Map<HgStatus.Kind, List<Path>> data = new TreeMap<HgStatus.Kind, List<Path>>();
+			final EnumMap<HgStatus.Kind, List<Path>> data = new EnumMap<HgStatus.Kind, List<Path>>(HgStatus.Kind.class);
 			final Map<Path, Path> copies = showCopies ? new HashMap<Path,Path>() : null;
 			
 			public void handleStatus(HgStatus s) {