neiam
/apollos_crib
It's Apollo's Crib
public · Issues · Pulls 1 · Labels · Forks · Compare · Actions failure · Badges · Packages
⭐
Log in to mark this repository.
Credo: no whole-list length just to compare it
d197dc1 · Gabe Morell · 2026-11-04 21:21
Files changed
modified
apps/room_air_quality/lib/room_air_quality/aqi_worker.ex
+1
−1
@@ -326,7 +326,7 @@ defmodule RoomAirQuality.Worker do
| 326 | 326 | |
| 327 | 327 | {:error, bad} -> |
| 328 | 328 | new_sample = |
| 329 | − if length(sample_errs) < 3 do | |
| 329 | + if Enum.count_until(sample_errs, 3) < 3 do | |
| 330 | 330 | [{cs.changes[:aqsid] || cs.data.aqsid, bad.errors} | sample_errs] |
| 331 | 331 | else |
| 332 | 332 | sample_errs |
modified
apps/room_gtfs/lib/room_gtfs/feed_tester.ex
+1
−1
@@ -278,7 +278,7 @@ defmodule RoomGtfs.FeedTester do
| 278 | 278 | end |
| 279 | 279 | |
| 280 | 280 | defp shown_prefixes(prefixes) do |
| 281 | − "#{Enum.join(Enum.take(prefixes, 6), ", ")}#{if length(prefixes) > 6, do: ", …", else: ""}" | |
| 281 | + "#{Enum.join(Enum.take(prefixes, 6), ", ")}#{if Enum.count_until(prefixes, 7) > 6, do: ", …", else: ""}" | |
| 282 | 282 | end |
| 283 | 283 | |
| 284 | 284 | defp do_check_agency(result, feed, source) do |
modified
apps/room_gtfs/lib/room_gtfs/gtfs_worker.ex
+1
−1
@@ -2802,7 +2802,7 @@ defmodule RoomGtfs.Debug do
| 2802 | 2802 | static_trip_ids = static |> Enum.map(& &1.trip_id) |
| 2803 | 2803 | |
| 2804 | 2804 | IO.puts( |
| 2805 | − "#{length(static)} static trips: #{inspect(Enum.take(static_trip_ids, 5))}#{if length(static_trip_ids) > 5, do: " ...", else: ""}" | |
| 2805 | + "#{length(static)} static trips: #{inspect(Enum.take(static_trip_ids, 5))}#{if Enum.count_until(static_trip_ids, 6) > 5, do: " ...", else: ""}" | |
| 2806 | 2806 | ) |
| 2807 | 2807 | |
| 2808 | 2808 | if rt_summary do |
modified
apps/room_sanctum/lib/room_sanctum/storage.ex
+1
−1
@@ -761,7 +761,7 @@ defmodule RoomSanctum.Storage do
| 761 | 761 | } |
| 762 | 762 | end) |
| 763 | 763 | # A single point is not a line, and a route with no usable geometry is noise. |
| 764 | − |> Enum.filter(&(length(&1.points) > 1)) | |
| 764 | + |> Enum.filter(&match?([_, _ | _], &1.points)) | |
| 765 | 765 | end |
| 766 | 766 | |
| 767 | 767 | # Every nth point, with the last one always kept so the line does not stop |
Parents: 10e4d95