*/
#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++) {
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
*/
#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++) {
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
if (s->head[h & s->hash_mask] != str+idx) {
s->prev[(str+idx) & s->w_mask] = s->head[h & s->hash_mask];
s->head[h & s->hash_mask] = str+idx;
+ if (idx == count-1) {
+ ret = s->prev[(str+idx) & s->w_mask];
+ }
}
}
- ret = s->prev[(str+count-1) & s->w_mask];
return ret;
}
#endif
if (s->head[s->ins_h] != str+idx) {
s->prev[(str+idx) & s->w_mask] = s->head[s->ins_h];
s->head[s->ins_h] = str+idx;
+ if (idx == count-1) {
+ ret = s->prev[(str+idx) & s->w_mask];
+ }
}
}
- ret = s->prev[(str+count-1) & s->w_mask];
return ret;
}