Browse Source

fixed default for reg/1 when item is a counter - again

git-svn-id: http://svn.ulf.wiger.net/gproc/branches/experimental-0906/gproc@40 f3948e33-8234-0410-8a80-a07eae3b6c4d
uwiger 15 years ago
parent
commit
64f8de5796
1 changed files with 4 additions and 8 deletions
  1. 4 8
      src/gproc.erl

+ 4 - 8
src/gproc.erl

@@ -272,19 +272,15 @@ reg({_,g,_} = Key, Value) ->
     %% anything global
     ?CHK_DIST,
     gproc_dist:reg(Key, Value);
-reg({T,l,_} = Key, Value) when T==n; T==a ->
-    %% local names and aggregated counters
-    call({reg, Key, Value});
-reg({c,l,_} = Key, Value) ->
-    %% local counter
+reg({a,l,_} = Key, Value) ->
+    local_reg(Key, Value);
+reg({T,l,_} = Key, Value) when T==n; T==c; T==a ->
+    %% local names, counters and aggregated counters
     if is_integer(Value) ->
             call({reg, Key, Value});
        true ->
             erlang:error(badarg)
     end;
-reg({_,l,_} = Key, Value) ->
-    %% local property
-    local_reg(Key, Value);
 reg(_, _) ->
     erlang:error(badarg).