From 7bc36204d385893702a944f32aa1902aca1e7377 Mon Sep 17 00:00:00 2001 From: William Morriss Date: Tue, 29 May 2018 16:31:26 -0700 Subject: move bytes and string to complex types section --- docs/types.rst | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'docs') diff --git a/docs/types.rst b/docs/types.rst index 794a70de..400c6fde 100644 --- a/docs/types.rst +++ b/docs/types.rst @@ -218,18 +218,6 @@ Members: 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 ----------------------------- - -``bytes``: - Dynamically-sized byte array, see :ref:`arrays`. Not a value-type! -``string``: - Dynamically-sized UTF-8-encoded string, see :ref:`arrays`. Not a value-type! - -As a rule of thumb, use ``bytes`` for arbitrary-length raw byte data and ``string`` -for arbitrary-length string (UTF-8) data. If you can limit the length to a certain -number of bytes, always use one of ``bytes1`` to ``bytes32`` because they are much cheaper. - .. index:: address, literal;address .. _address_literals: @@ -517,6 +505,18 @@ them can be quite expensive, we have to think about whether we want them to be stored in **memory** (which is not persisting) or **storage** (where the state variables are held). +Dynamically-sized byte array +---------------------------- + +``bytes``: + Dynamically-sized byte array, see :ref:`arrays`. Not a value-type! +``string``: + Dynamically-sized UTF-8-encoded string, see :ref:`arrays`. Not a value-type! + +As a rule of thumb, use ``bytes`` for arbitrary-length raw byte data and ``string`` +for arbitrary-length string (UTF-8) data. If you can limit the length to a certain +number of bytes, always use one of ``bytes1`` to ``bytes32`` because they are much cheaper. + Data location ------------- -- cgit v1.2.3