aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-08-30 05:53:50 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-09-02 02:09:36 +0800
commitf787ecae5a0186bb19a99ac8577123700b0c93a7 (patch)
tree7ad34c891b0115ea1019fdd6bbabd1fdfa15c93f
parent8743b2ceadd4a50e7137aca99b4fceeef780b55c (diff)
downloaddexon-solidity-f787ecae5a0186bb19a99ac8577123700b0c93a7.tar
dexon-solidity-f787ecae5a0186bb19a99ac8577123700b0c93a7.tar.gz
dexon-solidity-f787ecae5a0186bb19a99ac8577123700b0c93a7.tar.bz2
dexon-solidity-f787ecae5a0186bb19a99ac8577123700b0c93a7.tar.lz
dexon-solidity-f787ecae5a0186bb19a99ac8577123700b0c93a7.tar.xz
dexon-solidity-f787ecae5a0186bb19a99ac8577123700b0c93a7.tar.zst
dexon-solidity-f787ecae5a0186bb19a99ac8577123700b0c93a7.zip
Document byte[] vs bytes
-rw-r--r--docs/frequently-asked-questions.rst7
-rw-r--r--docs/types.rst4
2 files changed, 4 insertions, 7 deletions
diff --git a/docs/frequently-asked-questions.rst b/docs/frequently-asked-questions.rst
index ed09044e..694b28d5 100644
--- a/docs/frequently-asked-questions.rst
+++ b/docs/frequently-asked-questions.rst
@@ -441,13 +441,6 @@ The correct way to do this is the following::
}
}
-What is the difference between ``bytes`` and ``byte[]``?
-========================================================
-
-``bytes`` is usually more efficient: When used as arguments to functions (i.e. in
-CALLDATA) or in memory, every single element of a ``byte[]`` is padded to 32
-bytes which wastes 31 bytes per element.
-
Is it possible to send a value while calling an overloaded function?
====================================================================
diff --git a/docs/types.rst b/docs/types.rst
index 098d0380..23a70837 100644
--- a/docs/types.rst
+++ b/docs/types.rst
@@ -181,6 +181,10 @@ Members:
* ``.length`` yields the fixed length of the byte array (read-only).
+.. note::
+ It is possible to use an array of bytes as ``byte[]``, but it is wasting a lot of space, 31 bytes every element,
+ to be exact, when passing in calls. It is better to use ``bytes``.
+
Dynamically-sized byte array
----------------------------