Author: dreiss
Date: Tue Jun 10 17:59:27 2008
New Revision: 666429
URL: http://svn.apache.org/viewvc?rev=666429&view=rev
Log:
if instead of case for a guard comparison
Modified:
incubator/thrift/trunk/lib/alterl/src/thrift_binary_protocol.erl
incubator/thrift/trunk/lib/alterl/src/thrift_client.erl
Modified: incubator/thrift/trunk/lib/alterl/src/thrift_binary_protocol.erl
URL:
http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/alterl/src/thrift_binary_protocol.erl?rev=666429&r1=666428&r2=666429&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/alterl/src/thrift_binary_protocol.erl (original)
+++ incubator/thrift/trunk/lib/alterl/src/thrift_binary_protocol.erl Tue Jun 10
17:59:27 2008
@@ -91,8 +91,6 @@
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});
Modified: incubator/thrift/trunk/lib/alterl/src/thrift_client.erl
URL:
http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/alterl/src/thrift_client.erl?rev=666429&r1=666428&r2=666429&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/alterl/src/thrift_client.erl (original)
+++ incubator/thrift/trunk/lib/alterl/src/thrift_client.erl Tue Jun 10 17:59:27
2008
@@ -141,10 +141,10 @@
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 @@
handle_reply(State, Function, ReplyType)
end.
-
handle_reply(State = #state{protocol = Proto,
service = Service},
Function,