diff options
author | Sverker Eriksson <[email protected]> | 2019-03-21 22:32:05 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2019-03-22 19:40:06 +0100 |
commit | 78ea501bcc84bd8bd49da97e514c1c3b20682d86 (patch) | |
tree | b1e4d6533a483848f1a4ffc16cd17def15013878 /lib/erl_interface/src/encode/encode_port.c | |
parent | 0b74eec2a1fd5716ba6e21d8c6715433d8d34510 (diff) | |
download | otp-78ea501bcc84bd8bd49da97e514c1c3b20682d86.tar.gz otp-78ea501bcc84bd8bd49da97e514c1c3b20682d86.tar.bz2 otp-78ea501bcc84bd8bd49da97e514c1c3b20682d86.zip |
erl_interface: Remove old encoding of pid,port,refs
with tiny creation.
Diffstat (limited to 'lib/erl_interface/src/encode/encode_port.c')
-rw-r--r-- | lib/erl_interface/src/encode/encode_port.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/erl_interface/src/encode/encode_port.c b/lib/erl_interface/src/encode/encode_port.c index eb464380c0..0fb4018db1 100644 --- a/lib/erl_interface/src/encode/encode_port.c +++ b/lib/erl_interface/src/encode/encode_port.c @@ -25,7 +25,6 @@ int ei_encode_port(char *buf, int *index, const erlang_port *p) { char *s = buf + *index; - const char tag = p->creation > 3 ? ERL_NEW_PORT_EXT : ERL_PORT_EXT; ++(*index); /* skip ERL_PORT_EXT */ if (ei_encode_atom_len_as(buf, index, p->node, strlen(p->node), ERLANG_UTF8, @@ -33,19 +32,15 @@ int ei_encode_port(char *buf, int *index, const erlang_port *p) return -1; } if (buf) { - put8(s, tag); + put8(s, ERL_NEW_PORT_EXT); s = buf + *index; /* now the integers */ put32be(s,p->id & 0x0fffffff /* 28 bits */); - if (tag == ERL_PORT_EXT) { - put8(s,(p->creation & 0x03)); - } else { - put32be(s, p->creation); - } + put32be(s, p->creation); } - *index += 4 + (tag == ERL_PORT_EXT ? 1 : 4); + *index += 4 + 4; return 0; } |