From 9df28da12ab27b3e6301b3ba03dd9303ded6dfbc Mon Sep 17 00:00:00 2001 From: Bertrand Paquet Date: Tue, 3 Dec 2024 10:44:01 +0100 Subject: [PATCH] Better code --- load_test/lib/load_test/user/sse.ex | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/load_test/lib/load_test/user/sse.ex b/load_test/lib/load_test/user/sse.ex index df89e6f..af2ea4a 100644 --- a/load_test/lib/load_test/user/sse.ex +++ b/load_test/lib/load_test/user/sse.ex @@ -186,12 +186,9 @@ defmodule SseUser do end defp check_message(state, received_message, expected_message) do - [first | after_first] = String.split(received_message, "\n") + [first, _, third | _] = String.split(received_message, "\n") [_, id] = String.split(first, " ") - [_ | after_second] = after_first - [third | _] = after_second - try do [_, ts, message, _, _] = String.split(third, " ", parts: 5) current_ts = :os.system_time(:millisecond)