projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d7808b5
)
Apply suggestion to lib/pleroma/emoji/loader.ex
author
Maksim
<parallel588@gmail.com>
Thu, 29 Aug 2019 11:45:25 +0000
(11:45 +0000)
committer
Maksim Pechnikov
<parallel588@gmail.com>
Fri, 30 Aug 2019 04:30:54 +0000
(07:30 +0300)
lib/pleroma/emoji/loader.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/emoji/loader.ex
b/lib/pleroma/emoji/loader.ex
index 70eba9ac681d4cd5dd207b3a5f49a207b56172bb..82fc3b8c34b9834ef155cb3313744ddc7b3dd176 100644
(file)
--- a/
lib/pleroma/emoji/loader.ex
+++ b/
lib/pleroma/emoji/loader.ex
@@
-122,19
+122,17
@@
defmodule Pleroma.Emoji.Loader do
end
def find_all_emoji(dir, exts) do
- Enum.reduce(
- File.ls!(dir),
- [],
- fn f, acc ->
- filepath = Path.join(dir, f)
-
- if File.dir?(filepath) do
- acc ++ find_all_emoji(filepath, exts)
- else
- acc ++ [filepath]
- end
+ dir
+ |> File.ls!()
+ |> Enum.flat_map(fn f ->
+ filepath = Path.join(dir, f)
+
+ if File.dir?(filepath) do
+ find_all_emoji(filepath, exts)
+ else
+ [filepath]
end
- )
+
end
)
|> Enum.filter(fn f -> Path.extname(f) in exts end)
end