Skip to content

Commit

Permalink
remove unneeded stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
terraputix committed Feb 6, 2025
1 parent 90b5a0f commit e0a6675
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
7 changes: 0 additions & 7 deletions Swift/OmFileFormat/OmFileWriter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,6 @@ public final class OmFileWriterArray<OmType: OmFileArrayDataTypeProtocol, FileHa
self.scale_factor = scale_factor
self.add_offset = add_offset

if OmType.dataTypeArray == .string_array {
// string arrays need to have chunk dimensions of 1
if !chunkDimensions.allSatisfy({ $0 == 1 }) {
throw OmFileFormatSwiftError.omEncoder(error: "String arrays need to have chunk dimensions of 1")
}
}

// Note: The encoder keeps the pointer to `&self.dimensions`. It is important that this array is not deallocated!
self.encoder = OmEncoder_t()
let error = om_encoder_init(&encoder, scale_factor, add_offset, compression.toC(), OmType.dataTypeArray.toC(), &self.dimensions, &self.chunks, UInt64(dimensions.count))
Expand Down
5 changes: 3 additions & 2 deletions c/src/om_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ uint8_t om_get_bytes_per_element(OmDataType_t data_type, OmError_t* error) {
return 8;

case DATA_TYPE_STRING_ARRAY:
return 0; // strings are variable length
break;
// NOTE: Strings are variable length and should not be used with this function!
*error = ERROR_INVALID_DATA_TYPE;
return 0;

case DATA_TYPE_INT8:
case DATA_TYPE_UINT8:
Expand Down

0 comments on commit e0a6675

Please sign in to comment.