Skip to content

Commit

Permalink
isunitless: use is is instead of ==
Browse files Browse the repository at this point in the history
this is inferrable
  • Loading branch information
vtjnash authored Jun 6, 2017
1 parent 60367b1 commit 9a8dd68
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Unitful.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ const promotion = Dict{Symbol,Unit}()
include("User.jl")
const NoUnits = FreeUnits{(), Dimensions{()}}()
const NoDims = Dimensions{()}()
@inline isunitless{N}(::Units{N}) = N == ()
isunitless(::Units) = false
isunitless(::Units{()}) = true

(y::FreeUnits)(x::Number) = uconvert(y,x)
(y::ContextUnits)(x::Number) = uconvert(y,x)
Expand Down

0 comments on commit 9a8dd68

Please sign in to comment.