From 6f112f796a4d6a982b006b7ba89c3cd2a72b982a Mon Sep 17 00:00:00 2001 From: Eksperimental Date: Sat, 11 Jun 2022 07:39:46 -0500 Subject: [PATCH] Replace misspelt helper nillify with nilify --- lib/elixir/lib/kernel/parallel_compiler.ex | 8 ++++---- lib/elixir/lib/port.ex | 10 +++++----- lib/elixir/lib/process.ex | 16 ++++++++-------- lib/elixir/lib/uri.ex | 20 ++++++++++---------- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/lib/elixir/lib/kernel/parallel_compiler.ex b/lib/elixir/lib/kernel/parallel_compiler.ex index 8e57d089f6d..bf3bcdd267b 100644 --- a/lib/elixir/lib/kernel/parallel_compiler.ex +++ b/lib/elixir/lib/kernel/parallel_compiler.ex @@ -496,7 +496,7 @@ defmodule Kernel.ParallelCompiler do # i.e. to find code that depends on code that we know is not being defined. # Note that not all files have been compiled yet, so they may not be in waiting. defp without_definition(waiting, files) do - nillify_empty( + nilify_empty( for %{pid: pid} <- files, {_, _, ref, ^pid, on, _, _} <- waiting, not defining?(on, waiting), @@ -505,7 +505,7 @@ defmodule Kernel.ParallelCompiler do end defp deadlocked(waiting, type, defining?) do - nillify_empty( + nilify_empty( for {_, _, ref, _, on, _, ^type} <- waiting, defining?(on, waiting) == defining?, do: {ref, :deadlock} @@ -516,8 +516,8 @@ defmodule Kernel.ParallelCompiler do Enum.any?(waiting, fn {_, _, _, _, _, defining, _} -> on in defining end) end - defp nillify_empty([]), do: nil - defp nillify_empty([_ | _] = list), do: list + defp nilify_empty([]), do: nil + defp nilify_empty([_ | _] = list), do: list # Wait for messages from child processes defp wait_for_messages(queue, spawned, waiting, files, result, warnings, state) do diff --git a/lib/elixir/lib/port.ex b/lib/elixir/lib/port.ex index 9cd8112e86a..cd230ee8fbe 100644 --- a/lib/elixir/lib/port.ex +++ b/lib/elixir/lib/port.ex @@ -250,7 +250,7 @@ defmodule Port do """ @spec info(port) :: keyword | nil def info(port) do - nillify(:erlang.port_info(port)) + nilify(:erlang.port_info(port)) end @doc """ @@ -270,7 +270,7 @@ defmodule Port do end def info(port, item) do - nillify(:erlang.port_info(port, item)) + nilify(:erlang.port_info(port, item)) end @doc """ @@ -323,7 +323,7 @@ defmodule Port do :erlang.ports() end - @compile {:inline, nillify: 1} - defp nillify(:undefined), do: nil - defp nillify(other), do: other + @compile {:inline, nilify: 1} + defp nilify(:undefined), do: nil + defp nilify(other), do: other end diff --git a/lib/elixir/lib/process.ex b/lib/elixir/lib/process.ex index c46f2c9b463..d440330bccb 100644 --- a/lib/elixir/lib/process.ex +++ b/lib/elixir/lib/process.ex @@ -116,7 +116,7 @@ defmodule Process do """ @spec put(term, term) :: term | nil def put(key, value) do - nillify(:erlang.put(key, value)) + nilify(:erlang.put(key, value)) end @doc """ @@ -136,7 +136,7 @@ defmodule Process do """ @spec delete(term) :: term | nil def delete(key) do - nillify(:erlang.erase(key)) + nilify(:erlang.erase(key)) end @doc """ @@ -650,7 +650,7 @@ defmodule Process do """ @spec whereis(atom) :: pid | port | nil def whereis(name) do - nillify(:erlang.whereis(name)) + nilify(:erlang.whereis(name)) end @doc """ @@ -749,7 +749,7 @@ defmodule Process do """ @spec info(pid) :: keyword | nil def info(pid) do - nillify(:erlang.process_info(pid)) + nilify(:erlang.process_info(pid)) end @doc """ @@ -770,7 +770,7 @@ defmodule Process do end def info(pid, spec) when is_atom(spec) or is_list(spec) do - nillify(:erlang.process_info(pid, spec)) + nilify(:erlang.process_info(pid, spec)) end @doc """ @@ -788,7 +788,7 @@ defmodule Process do @spec hibernate(module, atom, list) :: no_return defdelegate hibernate(mod, fun_name, args), to: :erlang - @compile {:inline, nillify: 1} - defp nillify(:undefined), do: nil - defp nillify(other), do: other + @compile {:inline, nilify: 1} + defp nilify(:undefined), do: nil + defp nilify(other), do: other end diff --git a/lib/elixir/lib/uri.ex b/lib/elixir/lib/uri.ex index 87f253adef2..abb6fa4a8fe 100644 --- a/lib/elixir/lib/uri.ex +++ b/lib/elixir/lib/uri.ex @@ -794,9 +794,9 @@ defmodule URI do ], parts - path = nillify(path) - scheme = nillify(scheme) - query = nillify_query(query_with_question_mark) + path = nilify(path) + scheme = nilify(scheme) + query = nilify_query(query_with_question_mark) {authority, userinfo, host, port} = split_authority(authority_with_slashes) scheme = scheme && String.downcase(scheme) @@ -814,8 +814,8 @@ defmodule URI do } end - defp nillify_query("?" <> query), do: query - defp nillify_query(_other), do: nil + defp nilify_query("?" <> query), do: query + defp nilify_query(_other), do: nil # Split an authority into its userinfo, host and port parts. # @@ -834,17 +834,17 @@ defmodule URI do components = Regex.run(regex, authority) destructure [_, _, userinfo, host, _, port], components - userinfo = nillify(userinfo) - host = if nillify(host), do: host |> String.trim_leading("[") |> String.trim_trailing("]") - port = if nillify(port), do: String.to_integer(port) + userinfo = nilify(userinfo) + host = if nilify(host), do: host |> String.trim_leading("[") |> String.trim_trailing("]") + port = if nilify(port), do: String.to_integer(port) {authority, userinfo, host, port} end # Regex.run returns empty strings sometimes. We want # to replace those with nil for consistency. - defp nillify(""), do: nil - defp nillify(other), do: other + defp nilify(""), do: nil + defp nilify(other), do: other @doc """ Returns the string representation of the given [URI struct](`t:t/0`).