Skip to content

Commit

Permalink
Encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
gatesn committed Mar 22, 2024
1 parent 8d84f11 commit 6f7e601
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions vortex-array/src/serde/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,10 @@ impl<'a> ReadCtx<'a> {
}

pub fn read(&mut self) -> VortexResult<ArrayRef> {
let encoding_id = self.read_usize()? - 12345678;
let encoding_id = self.read_usize()?;
if let Some(serde) = ENCODINGS
.iter()
.filter(|e| {
e.id().name() == {
if encoding_id > self.encodings.len() {
panic!("Hmmm")
}
self.encodings[encoding_id].name()
}
})
.filter(|e| e.id().name() == self.encodings[encoding_id].name())
.flat_map(|e| e.serde())
.next()
{
Expand Down Expand Up @@ -248,7 +241,6 @@ impl<'a> WriteCtx<'a> {
.available_encodings
.iter()
.position(|e| e.name() == array.encoding().id().name())
.map(|i| i + 12345678)
.ok_or(io::Error::new(ErrorKind::InvalidInput, "unknown encoding"))?;
self.write_usize(encoding_id)?;
array.serde().map(|s| s.write(self)).unwrap_or_else(|| {
Expand Down

0 comments on commit 6f7e601

Please sign in to comment.