Explorar el Código

fix(stream): ensure that `chain/1` preserves the order

Andrew Mayorov hace 1 año
padre
commit
80ea2e62f7
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      apps/emqx_utils/src/emqx_utils_stream.erl

+ 1 - 1
apps/emqx_utils/src/emqx_utils_stream.erl

@@ -190,7 +190,7 @@ transpose_tail(S, Tail) ->
 %% @doc Make a stream by concatenating multiple streams.
 -spec chain([stream(X)]) -> stream(X).
 chain(L) ->
-    lists:foldl(fun chain/2, empty(), L).
+    lists:foldr(fun chain/2, empty(), L).
 
 %% @doc Make a stream by chaining (concatenating) two streams.
 %% The second stream begins to produce values only after the first one is exhausted.