From c525745c0e77daa03acb65739b26d1b87e50e496 Mon Sep 17 00:00:00 2001 From: David Reiss Date: Wed, 11 Jun 2008 00:59:27 +0000 Subject: [PATCH] if instead of case for a guard comparison git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666429 13f79535-47bb-0310-9956-ffa450edef68 --- lib/alterl/src/thrift_binary_protocol.erl | 2 -- lib/alterl/src/thrift_client.erl | 7 +++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/alterl/src/thrift_binary_protocol.erl b/lib/alterl/src/thrift_binary_protocol.erl index 05256218..633cfba0 100644 --- a/lib/alterl/src/thrift_binary_protocol.erl +++ b/lib/alterl/src/thrift_binary_protocol.erl @@ -91,8 +91,6 @@ write(This, set_end) -> ok; write(This, #protocol_struct_begin{}) -> ok; write(This, struct_end) -> ok; - - write(This, {bool, true}) -> write(This, {byte, 1}); write(This, {bool, false}) -> write(This, {byte, 0}); diff --git a/lib/alterl/src/thrift_client.erl b/lib/alterl/src/thrift_client.erl index c1d43aae..e1e78e77 100644 --- a/lib/alterl/src/thrift_client.erl +++ b/lib/alterl/src/thrift_client.erl @@ -141,10 +141,10 @@ send_function_call(#state{protocol = Proto, Args) -> Params = Service:function_info(Function, params_type), {struct, PList} = Params, - case length(PList) of - N when N =/= length(Args) -> + if + length(PList) =/= length(Args) -> throw({return, {error, {bad_args, Function, Args}}}); - _ -> ok + true -> ok end, Begin = #protocol_message_begin{name = atom_to_list(Function), @@ -182,7 +182,6 @@ read_result(State = #state{protocol = Proto, handle_reply(State, Function, ReplyType) end. - handle_reply(State = #state{protocol = Proto, service = Service}, Function, -- 2.17.1