From a09d99d02fc0ffdf33b55dbcabad4a824b52c336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Fri, 6 May 2011 15:31:44 +0200 Subject: Remove unnecessary copy in prim_file:drv_command/3 --- erts/preloaded/src/prim_file.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'erts/preloaded/src') diff --git a/erts/preloaded/src/prim_file.erl b/erts/preloaded/src/prim_file.erl index fb0aef8947..13e8e8fb5b 100644 --- a/erts/preloaded/src/prim_file.erl +++ b/erts/preloaded/src/prim_file.erl @@ -864,9 +864,9 @@ drv_command(Port, Command) -> drv_command(Port, Command, R) when is_binary(Command) -> drv_command(Port, Command, true, R); drv_command(Port, Command, R) -> - try erlang:iolist_to_binary(Command) of - Bin -> - drv_command(Port, Bin, true, R) + try erlang:iolist_size(Command) of + _ -> + drv_command(Port, Command, true, R) catch error:Reason -> {error, Reason} -- cgit v1.2.3