diff src/org/tmatesoft/hg/internal/IntVector.java @ 574:88afffd39899

Improve memory consumption of HgManifest#getFileRevision(): avoid extra byte[] instances
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 16 Apr 2013 14:44:57 +0200
parents e49f9d9513fa
children f41dd9a3b8af
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/IntVector.java	Fri Apr 12 19:50:21 2013 +0200
+++ b/src/org/tmatesoft/hg/internal/IntVector.java	Tue Apr 16 14:44:57 2013 +0200
@@ -142,7 +142,7 @@
 		if (increment == 0) {
 			throw new UnsupportedOperationException("This vector is not allowed to expand");
 		}
-		int newCapacity = increment < 0 ? data.length << 1 : data.length + increment;
+		int newCapacity = increment < 0 ? data.length << 1 : (data.length + increment);
 		if (newCapacityHint > 0 && newCapacity < newCapacityHint) {
 			newCapacity = newCapacityHint;
 		}