Skip to content

Commit

Permalink
fixup: Simplify syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
jmert committed Sep 20, 2020
1 parent 23220c5 commit d4d345e
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions src/HDF5.jl
Original file line number Diff line number Diff line change
Expand Up @@ -284,22 +284,22 @@ const ScalarOrString = Union{HDF5Scalar, String}
function _hdf5_type_map(class_id, is_signed, native_size)
if class_id == H5T_INTEGER
if is_signed == H5T_SGN_2
native_size === Csize_t(1) ? (return Int8) :
native_size === Csize_t(2) ? (return Int16) :
native_size === Csize_t(4) ? (return Int32) :
native_size === Csize_t(8) ? (return Int64) :
throw(KeyError(class_id, is_signed, native_size))
return native_size === Csize_t(1) ? Int8 :
native_size === Csize_t(2) ? Int16 :
native_size === Csize_t(4) ? Int32 :
native_size === Csize_t(8) ? Int64 :
throw(KeyError(class_id, is_signed, native_size))
else
native_size === Csize_t(1) ? (return UInt8) :
native_size === Csize_t(2) ? (return UInt16) :
native_size === Csize_t(4) ? (return UInt32) :
native_size === Csize_t(8) ? (return UInt64) :
throw(KeyError(class_id, is_signed, native_size))
return native_size === Csize_t(1) ? UInt8 :
native_size === Csize_t(2) ? UInt16 :
native_size === Csize_t(4) ? UInt32 :
native_size === Csize_t(8) ? UInt64 :
throw(KeyError(class_id, is_signed, native_size))
end
else
native_size === Csize_t(4) ? (return Float32) :
native_size === Csize_t(8) ? (return Float64) :
throw(KeyError(class_id, is_signed, native_size))
return native_size === Csize_t(4) ? Float32 :
native_size === Csize_t(8) ? Float64 :
throw(KeyError(class_id, is_signed, native_size))
end
end

Expand Down Expand Up @@ -999,46 +999,46 @@ function _prop_set!(p::HDF5Properties, name::Symbol, val, check::Bool = true)
class = p.class

if class == H5P_FILE_CREATE
name === :userblock ? (return h5p_set_userblock(p, val...)) :
name === :track_times ? (return h5p_set_obj_track_times(p, val...)) : # H5P_OBJECT_CREATE
check ? error("unknown file create property ", name) : return nothing
return name === :userblock ? h5p_set_userblock(p, val...) :
name === :track_times ? h5p_set_obj_track_times(p, val...) : # H5P_OBJECT_CREATE
check ? error("unknown file create property ", name) : nothing
end

if class == H5P_FILE_ACCESS
name === :alignment ? (return h5p_set_alignment(p, val...)) :
name === :fclose_degree ? (return h5p_set_fclose_degree(p, val...)) :
name === :libver_bounds ? (return h5p_set_libver_bounds(p, val...)) :
check ? error("unknown file access property ", name) : return nothing
return name === :alignment ? h5p_set_alignment(p, val...) :
name === :fclose_degree ? h5p_set_fclose_degree(p, val...) :
name === :libver_bounds ? h5p_set_libver_bounds(p, val...) :
check ? error("unknown file access property ", name) : nothing
end

if class == H5P_GROUP_CREATE
name === :local_heap_size_hint ? (return h5p_set_local_heap_size_hint(p, val...)) :
name === :track_times ? (return h5p_set_obj_track_times(p, val...)) : # H5P_OBJECT_CREATE
check ? error("unknown group create property ", name) : return nothing
return name === :local_heap_size_hint ? h5p_set_local_heap_size_hint(p, val...) :
name === :track_times ? h5p_set_obj_track_times(p, val...) : # H5P_OBJECT_CREATE
check ? error("unknown group create property ", name) : nothing
end

if class == H5P_LINK_CREATE
name === :char_encoding ? (return h5p_set_char_encoding(p, val...)) :
name === :create_intermediate_group ? (return h5p_set_create_intermediate_group(p, val...)) :
check ? error("unknown link create property ", name) : return nothing
return name === :char_encoding ? h5p_set_char_encoding(p, val...) :
name === :create_intermediate_group ? h5p_set_create_intermediate_group(p, val...) :
check ? error("unknown link create property ", name) : nothing
end

if class == H5P_DATASET_CREATE
name === :alloc_time ? (return h5p_set_alloc_time(p, val...)) :
name === :blosc ? (return h5p_set_blosc(p, val...)) :
name === :chunk ? (return set_chunk(p, val...)) :
name === :compress ? (return h5p_set_deflate(p, val...)) :
name === :deflate ? (return h5p_set_deflate(p, val...)) :
name === :external ? (return h5p_set_external(p, val...)) :
name === :layout ? (return h5p_set_layout(p, val...)) :
name === :shuffle ? (return h5p_set_shuffle(p, val...)) :
name === :track_times ? (return h5p_set_obj_track_times(p, val...)) : # H5P_OBJECT_CREATE
check ? error("unknown dataset create property ", name) : return nothing
return name === :alloc_time ? h5p_set_alloc_time(p, val...) :
name === :blosc ? h5p_set_blosc(p, val...) :
name === :chunk ? set_chunk(p, val...) :
name === :compress ? h5p_set_deflate(p, val...) :
name === :deflate ? h5p_set_deflate(p, val...) :
name === :external ? h5p_set_external(p, val...) :
name === :layout ? h5p_set_layout(p, val...) :
name === :shuffle ? h5p_set_shuffle(p, val...) :
name === :track_times ? h5p_set_obj_track_times(p, val...) : # H5P_OBJECT_CREATE
check ? error("unknown dataset create property ", name) : nothing
end

if class == H5P_ATTRIBUTE_CREATE
name === :char_encoding ? (return h5p_set_char_encoding(p, val...)) :
check ? error("unknown attribute create property ", name) : return nothing
return name === :char_encoding ? h5p_set_char_encoding(p, val...) :
check ? error("unknown attribute create property ", name) : nothing
end

check ? error("unknown property class ", class) : return nothing
Expand Down

0 comments on commit d4d345e

Please sign in to comment.