mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
string.c (mrb_memsearch_ss): remove useless alignment adjustment
Ref #6158
This commit is contained in:
@@ -600,17 +600,6 @@ mrb_memsearch_ss(const unsigned char *xs, long m, const unsigned char *ys, long
|
||||
#define MASK4 0x80
|
||||
#endif
|
||||
|
||||
#if ALIGNED_WORD_ACCESS
|
||||
if ((uintptr_t)ys % sizeof(bitint)) {
|
||||
int l = sizeof(bitint) - (bitint)ys % sizeof(bitint);
|
||||
const unsigned char *p = (unsigned char*)memchr(ys, *xs, l);
|
||||
if (p && (p - ys) < m) {
|
||||
if (memcmp(p, xs, m) == 0) return (mrb_int)(p - ys);
|
||||
ys = p;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
const bitint first = MASK1 * (uint8_t)xs[0];
|
||||
const bitint last = MASK1 * (uint8_t)xs[m-1];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user