summaryrefslogtreecommitdiff
path: root/src/gm.erl
diff options
context:
space:
mode:
authorMichael Klishin <michael@clojurewerkz.org>2017-11-23 15:37:58 +0300
committerMichael Klishin <michael@clojurewerkz.org>2017-11-23 15:37:58 +0300
commitff8f76dfa17d4e7e862d06caa96523f021de7b83 (patch)
tree628c4e82ade31c0ca386029132abc624b5c44d1a /src/gm.erl
parent51586b343bcd3b9bb2e3138e9f3a35d997d6fc1d (diff)
parent85fcede2b42713eb682b5e7968636f909b264aa4 (diff)
downloadrabbitmq-server-git-ff8f76dfa17d4e7e862d06caa96523f021de7b83.tar.gz
Merge branch 'stable'
Diffstat (limited to 'src/gm.erl')
-rw-r--r--src/gm.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gm.erl b/src/gm.erl
index 6ac0884081..6c0a786c33 100644
--- a/src/gm.erl
+++ b/src/gm.erl
@@ -1353,9 +1353,12 @@ find_common(A, B, Common) ->
find_common(A1, B1, queue:in(Val, Common));
{{empty, _A}, _} ->
{Common, B};
- {_, {_, B1}} ->
+ %% Drop value from B.
+ %% Match value to avoid infinite loop, since {empty, B} = queue:out(B).
+ {_, {{value, _}, B1}} ->
find_common(A, B1, Common);
- {{_, A1}, _} ->
+ %% Drop value from A. Empty A should be matched by second close.
+ {{{value, _}, A1}, _} ->
find_common(A1, B, Common)
end.