From d325968f73732e95181b60c997fdef1b2713a67b Mon Sep 17 00:00:00 2001 From: Daniel King Date: Thu, 10 Oct 2024 16:33:03 -0400 Subject: [PATCH] save an allocation --- vortex-sampling-compressor/src/compressors/chunked.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vortex-sampling-compressor/src/compressors/chunked.rs b/vortex-sampling-compressor/src/compressors/chunked.rs index f752b7ef2d..23ff730d17 100644 --- a/vortex-sampling-compressor/src/compressors/chunked.rs +++ b/vortex-sampling-compressor/src/compressors/chunked.rs @@ -39,9 +39,7 @@ impl EncodingCompressor for ChunkedCompressor { } fn can_compress(&self, array: &Array) -> Option<&dyn EncodingCompressor> { - ChunkedArray::try_from(array) - .ok() - .map(|_| self as &dyn EncodingCompressor) + array.is_encoding(Chunked::ID).then_some(self) } fn compress<'a>(