supabase / supavisor

A cloud-native, multi-tenant Postgres connection pooler.
https://supabase.github.io/supavisor/
Apache License 2.0
1.65k stars 54 forks source link

chore: use `or` instead of `||` #371

Closed hauleth closed 5 days ago

hauleth commented 1 week ago

What kind of change does this PR introduce?

Replace uses of || with or in cases where both sides of operator are for sure boolean.

Reason for that is that || works on other values than boolean, which mean that a || b is translated to:

case a do
  val when val in [nil, false] -> b
  _ -> a
end

Which needs to perform more tests and cannot be optimised that easily by the compiler. New code should be easier for compiler to optimise.