[freenet-cvs] r14978 - trunk/freenet/src/freenet/node/fcp

nextgens at freenetproject.org nextgens at freenetproject.org
Wed Sep 5 20:27:57 UTC 2007


Author: nextgens
Date: 2007-09-05 20:27:56 +0000 (Wed, 05 Sep 2007)
New Revision: 14978

Modified:
   trunk/freenet/src/freenet/node/fcp/AllDataMessage.java
Log:
Spare some memory in AllDataMessages (improvement suggested by toad)

Modified: trunk/freenet/src/freenet/node/fcp/AllDataMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/AllDataMessage.java	2007-09-05 17:05:05 UTC (rev 14977)
+++ trunk/freenet/src/freenet/node/fcp/AllDataMessage.java	2007-09-05 20:27:56 UTC (rev 14978)
@@ -17,15 +17,15 @@
 	final long dataLength;
 	final boolean global;
 	final String identifier;
-	final String startupTime, completionTime;
+	final long startupTime, completionTime;
 	
 	public AllDataMessage(Bucket bucket, String identifier, boolean global, long startupTime, long completionTime) {
 		this.bucket = bucket;
 		this.dataLength = bucket.size();
 		this.identifier = identifier;
 		this.global = global;
-		this.startupTime = String.valueOf(startupTime);
-		this.completionTime = String.valueOf(completionTime);
+		this.startupTime = startupTime;
+		this.completionTime = completionTime;
 	}
 
 	long dataLength() {
@@ -34,11 +34,11 @@
 
 	public SimpleFieldSet getFieldSet() {
 		SimpleFieldSet fs = new SimpleFieldSet(true);
-		fs.putSingle("DataLength", Long.toString(dataLength));
+		fs.put("DataLength", dataLength);
 		fs.putSingle("Identifier", identifier);
 		if(global) fs.putSingle("Global", "true");
-		fs.putSingle("StartuptTime", startupTime);
-		fs.putSingle("CompletionTime", completionTime);
+		fs.put("StartuptTime", startupTime);
+		fs.put("CompletionTime", completionTime);
 		return fs;
 	}
 




More information about the cvs mailing list