Does it cost more gas to call a function more than once in another function?
For example:
function getValue() public returns(uint){
return 5;
}
function getOtherValue() public returns(uint){
require(getValue() < 6, "Error:Too much");
require(getValue() > 4, "Error:Too little");
return getValue() -1;
}
Does this other getOtherValue()
function below use less gas, the same gas or even more gas than the one above?
function getOtherValue() public returns(uint){
uint gottenValue = getValue();
require(gottenValue < 6, "Error:Too much");
require(gottenValue > 4, "Error:Too little");
return gottenValue -1;
}
CALL
instructionsolc --optimize
solc
and Golang