Commit 570dab1234022fc9e39067524a50c5046a5ce29d

Thomas de Grivel 2024-10-10T11:05:39

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 ab43998..2320b58 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)
-              file = system(["sh", "-c",
-                             "head -c 80 #{sh_path} | hexdump -C"])
-              Str.slice(file, 0, 77) + "..."
+              Str.slice(system(["sh", "-c",
+                                "head -c 80 #{sh_path} | hexdump -C"]),
+                0, 77) + "..."
             else
               system(["hexdump", "-C", path])
             end