From 49be3446d589f64eeb8413deeeb7eb537f24c9f2 Mon Sep 17 00:00:00 2001 From: Igor Akkerman Date: Wed, 11 Feb 2015 13:09:36 +0100 Subject: [PATCH] argument validation optimized --- .../storage/capacity/AbstractSplitCapacityStrategy.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/org/jlib/container/storage/capacity/AbstractSplitCapacityStrategy.java b/src/main/java/org/jlib/container/storage/capacity/AbstractSplitCapacityStrategy.java index f251fa0b..add66547 100644 --- a/src/main/java/org/jlib/container/storage/capacity/AbstractSplitCapacityStrategy.java +++ b/src/main/java/org/jlib/container/storage/capacity/AbstractSplitCapacityStrategy.java @@ -38,12 +38,11 @@ protected AbstractSplitCapacityStrategy(final LinearIndexStorage storage, public void ensureSplitCapacity(final int splitIndex, final int splitCapacity) throws InvalidIndexException { ensureIndexValid(splitIndex); + ensureCapacityValid(splitCapacity); if (splitCapacity == 0) return; - ensureCapacityValid(splitCapacity); - safeEnsureSplitCapacity(splitIndex, splitCapacity); getContentIndexRange().incrementMaximum(splitCapacity);