couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From beno...@apache.org
Subject [17/23] goldrush commit: updated refs/heads/import-master to 71e6321
Date Thu, 13 Feb 2014 16:35:50 GMT
Remove unnecessary code, add consistency


Project: http://git-wip-us.apache.org/repos/asf/couchdb-goldrush/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-goldrush/commit/87bb89be
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-goldrush/tree/87bb89be
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-goldrush/diff/87bb89be

Branch: refs/heads/import-master
Commit: 87bb89bede51c2f3a020676598b1820941c4a076
Parents: 1804245
Author: Pedram Nimreezi <deadzen@deadzen.com>
Authored: Thu Nov 7 16:13:02 2013 -0500
Committer: Pedram Nimreezi <deadzen@deadzen.com>
Committed: Thu Nov 7 16:13:02 2013 -0500

----------------------------------------------------------------------
 src/glc_code.erl   |  2 +-
 src/gr_counter.erl | 14 +++++++-------
 src/gr_param.erl   |  9 +--------
 3 files changed, 9 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-goldrush/blob/87bb89be/src/glc_code.erl
----------------------------------------------------------------------
diff --git a/src/glc_code.erl b/src/glc_code.erl
index 1111bd9..c966e59 100644
--- a/src/glc_code.erl
+++ b/src/glc_code.erl
@@ -326,7 +326,7 @@ abstract_count(Counter) ->
 %% @todo Pass state record. Only Generate code if `statistics' is enabled.
 -spec abstract_getcount(atom()) -> [syntaxTree()].
 abstract_getcount(Counter) ->
-    [abstract_apply(gr_counter, check,
+    [abstract_apply(gr_counter, lookup_element,
         [abstract_apply(table, [?erl:atom(counters)]),
          ?erl:abstract(Counter)])].
 

http://git-wip-us.apache.org/repos/asf/couchdb-goldrush/blob/87bb89be/src/gr_counter.erl
----------------------------------------------------------------------
diff --git a/src/gr_counter.erl b/src/gr_counter.erl
index 76f7dd5..d2276f1 100644
--- a/src/gr_counter.erl
+++ b/src/gr_counter.erl
@@ -18,7 +18,7 @@
 
 %% API
 -export([start_link/1, 
-         check/1, check/2,
+         list/1, lookup_element/2,
          update/3]).
 
 %% gen_server callbacks
@@ -34,11 +34,11 @@
 %%%===================================================================
 %%% API
 %%%===================================================================
-check(Server) ->
-    gen_server:call(Server, check).
+list(Server) ->
+    gen_server:call(Server, list).
 
-check(Server, Counter) ->
-    gen_server:call(Server, {check, Counter}).
+lookup_element(Server, Counter) ->
+    gen_server:call(Server, {lookup_element, Counter}).
 
 update(Server, Counter, Value) ->
     gen_server:cast(Server, {update, Counter, Value}).
@@ -85,10 +85,10 @@ init([]) ->
 %%                                   {stop, Reason, State}
 %% @end
 %%--------------------------------------------------------------------
-handle_call(check, _From, State) ->
+handle_call(list, _From, State) ->
     TableId = State#state.table_id,
     {reply, {ok, ets:tab2list(TableId)}, State};
-handle_call({check, Counter}, _From, State) ->
+handle_call({lookup_element, Counter}, _From, State) ->
     TableId = State#state.table_id,
     {reply, ets:lookup_element(TableId, Counter, 2), State};
 handle_call(_Request, _From, State) ->

http://git-wip-us.apache.org/repos/asf/couchdb-goldrush/blob/87bb89be/src/gr_param.erl
----------------------------------------------------------------------
diff --git a/src/gr_param.erl b/src/gr_param.erl
index 700d6c3..e7ac2a2 100644
--- a/src/gr_param.erl
+++ b/src/gr_param.erl
@@ -20,7 +20,7 @@
 -export([start_link/1, 
          list/1, size/1, insert/2, 
          lookup/2, lookup_element/2,
-         info/1, update/2, transform/1]).
+         info/1, transform/1]).
 
 %% gen_server callbacks
 -export([init/1,
@@ -53,9 +53,6 @@ lookup_element(Server, Term) ->
 info(Server) ->
     gen_server:call(Server, info).
 
-update(Counter, Value) ->
-    gen_server:cast(?MODULE, {update, Counter, Value}).
-
 %% @doc Transform Term -> Key to Key -> Term
 transform(Server) ->
     gen_server:call(Server, transform).
@@ -140,10 +137,6 @@ handle_call(_Request, _From, State) ->
 %%                                  {stop, Reason, State}
 %% @end
 %%--------------------------------------------------------------------
-handle_cast({update, Counter, Value}, State) ->
-    TableId = State#state.table_id,
-    ets:update_counter(TableId, Counter, Value),
-    {noreply, State};
 handle_cast(_Msg, State) ->
     {noreply, State}.
 


Mime
View raw message