I'm getting the warning
Gas requirement of function helloWorld.getGreeting() high: infinite. If the gas requirement of a function is higher than the block gas limit, it cannot be executed. Please avoid loops in your functions or actions that modify large areas of storage (this includes clearing or copying arrays in storage)
in the following contract
pragma solidity ^0.4.22;
contract helloWorld {
string public greeting;
string[] public greetings;
constructor() public {
greeting = 'hello World';
greetings.length= greetings.length + 1;
}
function setGreeting(string _newGreeting) public {
greeting = _newGreeting;
greetings.push(_newGreeting);
}
function getGreeting() public view returns (string) {
return greeting;
}
}
I would like to be able to have the contract with none of these warnings, any help would be great !
thanks in advance !