diff src/org/tmatesoft/hg/internal/IntVector.java @ 573:e49f9d9513fa

Partial blame when start/end revisions are in the middle of a single filename history
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 12 Apr 2013 19:50:21 +0200
parents d3c71498919c
children 88afffd39899
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/IntVector.java	Fri Apr 12 18:30:55 2013 +0200
+++ b/src/org/tmatesoft/hg/internal/IntVector.java	Fri Apr 12 19:50:21 2013 +0200
@@ -84,6 +84,13 @@
 		count = 0;
 	}
 	
+	public void trimTo(int newSize) {
+		if (newSize < 0 || newSize > count) {
+			throw new IllegalArgumentException(String.format("Can't trim vector of size %d to %d", count, newSize));
+		}
+		count = newSize;
+	}
+	
 	public void trimToSize() {
 		data = toArray(true);
 	}