MCPcopy Index your code
hub / github.com/antlr/codebuff / computeArrayListCapacity

Method computeArrayListCapacity

output/java_guava/1.4.18/Lists.java:121–127  ·  view source on GitHub ↗
(int arraySize)

Source from the content-addressed store, hash-verified

119 }
120
121 @VisibleForTesting
122 static int computeArrayListCapacity(int arraySize) {
123 checkNonnegative(arraySize, "arraySize");
124
125 // TODO(kevinb): Figure out the right behavior, and document it
126 return Ints.saturatedCast(5L + arraySize + (arraySize / 10));
127 }
128
129 /**
130 * Creates a <i>mutable</i> {@code ArrayList} instance containing the given

Callers 2

newArrayListMethod · 0.95

Calls 2

saturatedCastMethod · 0.95
checkNonnegativeMethod · 0.45

Tested by

no test coverage detected