Commit 0740caf9ca64a59cf60743b9f59f9a70e0eeb31e

Thomas de Grivel 2024-10-10T11:02:47

wip fx speed

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/httpd/fx/app/views/fx_view.kc3 b/httpd/fx/app/views/fx_view.kc3
index 0b79fb3..9862b22 100644
--- a/httpd/fx/app/views/fx_view.kc3
+++ b/httpd/fx/app/views/fx_view.kc3
@@ -61,9 +61,9 @@ defmodule FXView do
           else
             file = if (size == :small) do
               sh_path = Sh.escape(path)
-              Str.slice(system(["sh", "-c",
-                                "head -c 80 #{sh_path} | hexdump -C"]),
-                0, 77) + "..."
+              file = system(["sh", "-c",
+                             "head -c 80 #{sh_path} | hexdump -C"])
+              Str.slice(file, 0, 77) + "..."
             else
               system(["hexdump", "-C", path])
             end