Permalink
Browse files

don't allocate new Strings--just a wasted op

  • Loading branch information...
1 parent 012bb17 commit 4443fb2b9278d72ded3d0c88da7d6519f520be8c @mebigfatguy committed Dec 26, 2010
@@ -580,7 +580,7 @@ public void operate() {
}
}
- fetchDirPath = new String(fetchDir.getAbsolutePath());
+ fetchDirPath = fetchDir.getAbsolutePath();
}
@Override
@@ -83,7 +83,7 @@ public static void main(String args[]) throws IOException {
HashMap<Integer, Long> requestRouting = Maps.newHashMap();
Long total = new Long(0);
for(int i = 0; i < numKeys; i++) {
- List<Node> nodes = strategy.routeRequest(new String("key" + i).getBytes());
+ List<Node> nodes = strategy.routeRequest(("key" + i).getBytes());
for(Node node: nodes) {
Long count = requestRouting.get(node.getId());
if(count == null) {

0 comments on commit 4443fb2

Please sign in to comment.