Credo: a group's depth from :binary.matches, not graphemes

fa42332 · Gabe Morell · 2026-11-04 21:31

4 files +1 -1

Files changed

modified lib/feed_pug_web/live/groups_live.ex
+1 −1
@@ -271,5 +271,5 @@ defmodule FeedPugWeb.GroupsLive do
271 271
272 272 defp display_path(group), do: String.replace(group.path, ".", ":")
273 273
274 − defp depth(group), do: group.path |> String.graphemes() |> Enum.count(&(&1 == "."))
274 + defp depth(group), do: group.path |> :binary.matches(".") |> length()
275 275 end

Parents: 0a528ae