Get pointer from address of c directly
This commit is contained in:
parent
34c343ac27
commit
f55e4d036c
@ -118,9 +118,9 @@ pub fn unrolled_find_u16s(needle: u16, haystack: &[u16]) -> Option<usize> {
|
||||
start = &start[8..];
|
||||
}
|
||||
|
||||
for (i, c) in start.iter().enumerate() {
|
||||
for c in start {
|
||||
if *c == needle {
|
||||
return Some((start.as_ptr() as usize - ptr as usize) / 2 + i);
|
||||
return Some((c as *const u16 as usize - ptr as usize) / 2);
|
||||
}
|
||||
}
|
||||
None
|
||||
|
Loading…
Reference in New Issue
Block a user