Mercurial > jhg
diff src/org/tmatesoft/hg/core/HgChangeset.java @ 196:e2115da4cf6a
Pool objects to avoid memory polution with duplicates
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Mon, 18 Apr 2011 18:04:24 +0200 |
parents | c9b305df0b89 |
children | 644ee58c9f16 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/core/HgChangeset.java Fri Apr 15 05:17:44 2011 +0200 +++ b/src/org/tmatesoft/hg/core/HgChangeset.java Mon Apr 18 18:04:24 2011 +0200 @@ -64,7 +64,7 @@ /*package-local*/ void init(int localRevNumber, Nodeid nid, RawChangeset rawChangeset) { revNumber = localRevNumber; nodeid = nid; - changeset = rawChangeset; + changeset = rawChangeset.clone(); modifiedFiles = addedFiles = null; deletedFiles = null; parent1 = parent2 = null; @@ -169,7 +169,7 @@ public HgChangeset clone() { try { HgChangeset copy = (HgChangeset) super.clone(); - copy.changeset = changeset.clone(); + // copy.changeset references this.changeset, doesn't need own copy return copy; } catch (CloneNotSupportedException ex) { throw new InternalError(ex.toString());