mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 03:00:17 +00:00
Fix Dialyzer (race condition) warning
This commit is contained in:
parent
fe1652e137
commit
a176db6937
1 changed files with 5 additions and 4 deletions
|
@ -190,10 +190,11 @@ expand_env_variable(InStr, VarName, RawVarValue) ->
|
|||
|
||||
vcs_vsn(Vcs, Dir) ->
|
||||
Key = {Vcs, Dir},
|
||||
case ets:lookup(rebar_vsn_cache, Key) of
|
||||
[{Key, VsnString}] ->
|
||||
VsnString;
|
||||
[] ->
|
||||
try ets:lookup_element(rebar_vsn_cache, Key, 2) of
|
||||
VsnString ->
|
||||
VsnString
|
||||
catch
|
||||
error:badarg ->
|
||||
VsnString = vcs_vsn_1(Vcs, Dir),
|
||||
ets:insert(rebar_vsn_cache, {Key, VsnString}),
|
||||
VsnString
|
||||
|
|
Loading…
Reference in a new issue