aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kronovet <kronovet@gmail.com>2018-06-03 17:25:52 +0800
committerGitHub <noreply@github.com>2018-06-03 17:25:52 +0800
commit0d4adc44c9ef269b81f42fc56658a7b0e1f3156c (patch)
treeb516b17efab8dda27ab1978dd6e24b483b3f3be0
parent0a1a8bfb09f996ad288baf4f195d621e143de7d9 (diff)
downloaddexon-solidity-0d4adc44c9ef269b81f42fc56658a7b0e1f3156c.tar.gz
dexon-solidity-0d4adc44c9ef269b81f42fc56658a7b0e1f3156c.tar.zst
dexon-solidity-0d4adc44c9ef269b81f42fc56658a7b0e1f3156c.zip
Update function visibility example
Two functions don't access state and should be `pure`. Also, inconsistent spacing when using arithmetic.
-rw-r--r--docs/contracts.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/contracts.rst b/docs/contracts.rst
index a083b9e9..fa6b4564 100644
--- a/docs/contracts.rst
+++ b/docs/contracts.rst
@@ -194,10 +194,10 @@ In the following example, ``D``, can call ``c.getData()`` to retrieve the value
contract C {
uint private data;
- function f(uint a) private returns(uint b) { return a + 1; }
+ function f(uint a) private pure returns(uint b) { return a + 1; }
function setData(uint a) public { data = a; }
function getData() public returns(uint) { return data; }
- function compute(uint a, uint b) internal returns (uint) { return a+b; }
+ function compute(uint a, uint b) internal pure returns (uint) { return a + b; }
}
contract D {