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@42 f3948e33-8234-0410-8a80-a07eae3b6c4d
uwiger 15 years ago
parent
commit
cc2c80edb2
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/gproc.erl

+ 4 - 3
src/gproc.erl

@@ -276,11 +276,12 @@ reg({p,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});
+    if T=/=n andalso is_integer(Value) ->
+	    true;
        true ->
             erlang:error(badarg)
-    end;
+    end,
+    call({reg, Key, Value});
 reg(_, _) ->
     erlang:error(badarg).