你会做什么?
doThings(folder.getInstructions()) ;
for (Instruction instruction : folder.getInstructions()) {
// do things
}
functionCall(folder.getInstructions()) ;
或这个 :
instructions = folder.getInstructions() ;
doThings(instructions)
for (Instruction instruction : instructions) {
// do things
}
functionCall(instructions) ;
最重要的是,我想知道何时将值存储在局部变量中更有效,何时进行函数调用更好。