@@ -147,15 +147,15 @@ mgets(ClusterName, Keys) ->
147147 ok | {error , Reason :: term ()}.
148148add (ClusterName , Key , Value , ExpTime , Timeout )
149149 when is_atom (ClusterName ), is_binary (Value ), is_integer (ExpTime ) ->
150- BExpTime = list_to_binary ( integer_to_list ( ExpTime ) ),
150+ BExpTime = integer_to_binary ( ExpTime ),
151151 mero_conn :add (ClusterName , Key , Value , BExpTime , Timeout ).
152152
153153-spec madd (ClusterName :: atom (),
154154 [{Key :: mero_key (), Value :: binary (), ExpTime :: integer ()}],
155155 Timeout :: integer ()) ->
156156 [ok | {error , Reason :: term ()}].
157157madd (ClusterName , KVEs , Timeout ) when is_atom (ClusterName ) ->
158- L = [{Key , Value , list_to_binary ( integer_to_list ( ExpTime ) )}
158+ L = [{Key , Value , integer_to_binary ( ExpTime )}
159159 || {Key , Value , ExpTime } <- KVEs , is_binary (Key ), is_binary (Value ), is_integer (ExpTime )],
160160 mero_conn :madd (ClusterName , L , Timeout ).
161161
@@ -191,7 +191,7 @@ mset(ClusterName, KVEs, Timeout) ->
191191
192192cas (ClusterName , Key , Value , ExpTime , Timeout , CAS )
193193 when is_atom (ClusterName ), is_binary (Value ), is_integer (ExpTime ) ->
194- BExpTime = list_to_binary ( integer_to_list ( ExpTime ) ),
194+ BExpTime = integer_to_binary ( ExpTime ),
195195 % % note: if CAS is undefined, this will be an unconditional set:
196196 mero_conn :set (ClusterName , Key , Value , BExpTime , Timeout , CAS ).
197197
@@ -203,7 +203,7 @@ cas(ClusterName, Key, Value, ExpTime, Timeout, CAS)
203203
204204mcas (ClusterName , KVECs , Timeout ) when is_atom (ClusterName ) ->
205205 % % note: if CAS is undefined, the corresponding set will be unconditional.
206- L = [{Key , Value , list_to_binary ( integer_to_list ( ExpTime ) ), CAS }
206+ L = [{Key , Value , integer_to_binary ( ExpTime ), CAS }
207207 || {Key , Value , ExpTime , CAS } <- KVECs ,
208208 is_binary (Key ),
209209 is_binary (Value ),
@@ -234,9 +234,9 @@ increment_counter(ClusterName, Key) when is_atom(ClusterName) ->
234234increment_counter (ClusterName , Key , Value , Initial , ExpTime , Retries , Timeout )
235235 when is_integer (Value ), is_integer (ExpTime ), is_atom (ClusterName ), Initial >= 0 ,
236236 Value >= 0 ->
237- BValue = list_to_binary ( integer_to_list ( Value ) ),
238- BInitial = list_to_binary ( integer_to_list ( Initial ) ),
239- BExpTime = list_to_binary ( integer_to_list ( ExpTime ) ),
237+ BValue = integer_to_binary ( Value ),
238+ BInitial = integer_to_binary ( Initial ),
239+ BExpTime = integer_to_binary ( ExpTime ),
240240 mero_conn :increment_counter (ClusterName ,
241241 Key ,
242242 BValue ,
@@ -265,9 +265,9 @@ mincrement_counter(ClusterName, Keys) when is_atom(ClusterName), is_list(Keys) -
265265mincrement_counter (ClusterName , Keys , Value , Initial , ExpTime , Timeout )
266266 when is_list (Keys ), is_integer (Value ), is_integer (ExpTime ), is_atom (ClusterName ),
267267 Initial >= 0 , Value >= 0 ->
268- BValue = list_to_binary ( integer_to_list ( Value ) ),
269- BInitial = list_to_binary ( integer_to_list ( Initial ) ),
270- BExpTime = list_to_binary ( integer_to_list ( ExpTime ) ),
268+ BValue = integer_to_binary ( Value ),
269+ BInitial = integer_to_binary ( Initial ),
270+ BExpTime = integer_to_binary ( ExpTime ),
271271 mero_conn :mincrement_counter (ClusterName , Keys , BValue , BInitial , BExpTime , Timeout ).
272272
273273-spec delete (ClusterName :: atom (), Key :: mero_key (), Timeout :: integer ()) ->
0 commit comments