zhuqi-lucas commented on code in PR #7731: URL: https://github.com/apache/arrow-rs/pull/7731#discussion_r2160529045
########## arrow-ord/src/cmp.rs: ########## @@ -565,24 +565,46 @@ impl<'a, T: ByteViewType> ArrayOrd for &'a GenericByteViewArray<T> { /// Item.0 is the array, Item.1 is the index type Item = (&'a GenericByteViewArray<T>, usize); + #[inline(always)] fn is_eq(l: Self::Item, r: Self::Item) -> bool { - // # Safety - // The index is within bounds as it is checked in value() let l_view = unsafe { l.0.views().get_unchecked(l.1) }; - let l_len = *l_view as u32; - let r_view = unsafe { r.0.views().get_unchecked(r.1) }; + let l_len = *l_view as u32; let r_len = *r_view as u32; // This is a fast path for equality check. // We don't need to look at the actual bytes to determine if they are equal. if l_len != r_len { return false; } + // When both len are same, we can compare the inlined bytes, this can handle the corner case after Review Comment: I agree with you @Dandandan , thank you for catching this! Addressed in latest PR. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org