mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-01-05 16:52:55 +00:00
Clippy comments
Clippy complaints that about the cast of &[u32] to a *const __m128i,
because of the lack of alignment constraints.
This commit passes the OutputBuffer object (which enforces proper
alignment) instead of `&[u32]`.
This commit is contained in:
@@ -127,14 +127,12 @@ impl BlockSearcher {
|
||||
/// then we use a different implementation that does an exhaustive linear search over
|
||||
/// the full block whenever the block is full (`len == 128`). It is surprisingly faster, most likely because of the lack
|
||||
/// of branch.
|
||||
pub fn search_in_block(&self, block_docs: &[u32], start: usize, target: u32) -> usize {
|
||||
pub fn search_in_block(self, block_docs: &[u32], start: usize, target: u32) -> usize {
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
{
|
||||
use postings::compression::COMPRESSION_BLOCK_SIZE;
|
||||
if *self == BlockSearcher::SSE2 {
|
||||
if block_docs.len() == COMPRESSION_BLOCK_SIZE {
|
||||
return sse2::linear_search_sse2_128(block_docs, target);
|
||||
}
|
||||
if self == BlockSearcher::SSE2 && block_docs.len() == COMPRESSION_BLOCK_SIZE {
|
||||
return sse2::linear_search_sse2_128(block_docs, target);
|
||||
}
|
||||
}
|
||||
start + galloping(&block_docs[start..], target)
|
||||
|
||||
Reference in New Issue
Block a user