diff options
Diffstat (limited to 'arch/arm/insert_string_acle.c')
-rw-r--r-- | arch/arm/insert_string_acle.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/arm/insert_string_acle.c b/arch/arm/insert_string_acle.c index 985b726..419ddff 100644 --- a/arch/arm/insert_string_acle.c +++ b/arch/arm/insert_string_acle.c @@ -20,12 +20,13 @@ */ #ifdef ARM_ACLE_CRC_HASH Pos insert_string_acle(deflate_state *const s, const Pos str, unsigned int count) { - Pos p, lp; + Pos p, lp, ret; if (unlikely(count == 0)) { return s->prev[str & s->w_mask]; } + ret = 0; lp = str + count - 1; /* last position */ for (p = str; p <= lp; p++) { @@ -43,8 +44,11 @@ Pos insert_string_acle(deflate_state *const s, const Pos str, unsigned int count if (s->head[hm] != p) { s->prev[p & s->w_mask] = s->head[hm]; s->head[hm] = p; + if (p == lp) { + ret = s->prev[lp & s->w_mask]); + } } } - return s->prev[lp & s->w_mask]; + return ret; } #endif |