-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,7 +102,11 @@ type DataTable <: AbstractDataTable | |
if isa(c, Range) | ||
columns[i] = collect(c) | ||
elseif !isa(c, AbstractVector) | ||
throw(DimensionMismatch("columns must be 1-dimensional")) | ||
if isa(c, AbstractArray) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
cjprybol
Author
Contributor
|
||
throw(DimensionMismatch("columns must be 1-dimensional")) | ||
else | ||
columns[i] = [c] | ||
end | ||
else | ||
columns[i] = c | ||
end | ||
|
This double branch with twice the same instruction isn't pretty. How about just having a
isa(c, AbstractArray) && !isa(c, AbstractVector)
check?