In the below scenario, all 3 getXxxxx()
methods simple return a property of that class with no additional processing.
Is it more efficient for me to assign them to a temporary variable like I've done with workLimit
, or should I just use the getter like I did with getCurrentWork()
?
int x = 0;
int workLimit = entity.getCurrentWorkLimit();
JobSet jobSet;
JobSetQueue queue = workflowProcess.getQueue();
while (x < workLimit && (jobSet = queue.poll()) != null) {
getCurrentWork().addLast(jobSet);
}