This may seem tedious, but I know that in JavaScript it was best practices for optimization to declare a local variable if an object property would be used more than once. For example:
var i, length = array.length;
for(i = 0; i < length; i++) {
console.log(length);
}
I was curious if in Java whether that would be the same case, such as in this example where I use values.length
twice.
for(int i = 0; i < values.length && length < values.length + i; i++) {
vector[i + index] = values[i];
}