Skip to content

Commit 8371346

Browse files
committed
Simplify dev_version? check using String.contains?/2
1 parent 11cf657 commit 8371346

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎lib/bob/job/docker_checker.ex‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ defmodule Bob.Job.DockerChecker do
189189
end
190190

191191
defp build_ubuntu_26?(erlang_version) do
192-
dev_version? = length(String.split(erlang_version, "-")) > 1
192+
dev_version? = String.contains?(erlang_version, "-")
193193

194194
# C23 compatibility (`bool` keyword)
195195
case parse_otp_ref(erlang_version) do

‎lib/bob/job/otp_checker.ex‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ defmodule Bob.Job.OTPChecker do
3535
end
3636

3737
defp build_ubuntu_24?(erlang_version) do
38-
dev_version? = length(String.split(erlang_version, "-")) > 1
38+
dev_version? = String.contains?(erlang_version, "-")
3939

4040
# WX compatibility
4141
case parse_otp_ref(erlang_version) do
@@ -48,7 +48,7 @@ defmodule Bob.Job.OTPChecker do
4848
end
4949

5050
defp build_ubuntu_26?(erlang_version) do
51-
dev_version? = length(String.split(erlang_version, "-")) > 1
51+
dev_version? = String.contains?(erlang_version, "-")
5252

5353
# C23 compatibility (`bool` keyword)
5454
case parse_otp_ref(erlang_version) do

0 commit comments

Comments
 (0)