diff options
author | Hans Kristian Rosbach <hk-git@circlestorm.org> | 2015-06-26 15:22:36 +0200 |
---|---|---|
committer | Hans Kristian Rosbach <hk-git@circlestorm.org> | 2015-06-26 15:22:36 +0200 |
commit | 6d91b4ae5a684fcdb6cdd2e7315ec80efb7df064 (patch) | |
tree | feadd10f9494dd82ac04b70cea856380742348af /deflate_medium.c | |
parent | 785a1ec85ffa6f1d700a7cdb975bffdd7f2e9ac5 (diff) |
Make bulk_insert implementation of insert_match behave more like
the original code, this also lets us optimize the match_length=1 case.
Diffstat (limited to 'deflate_medium.c')
-rw-r--r-- | deflate_medium.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/deflate_medium.c b/deflate_medium.c index 995a2cb..0c724b9 100644 --- a/deflate_medium.c +++ b/deflate_medium.c @@ -69,9 +69,12 @@ static void insert_match(deflate_state *s, struct match match) { } } #else - match.strstart++; - match.match_length--; - if (match.match_length > 0) { + if (likely(match.match_length == 1)) { + match.strstart++; + match.match_length = 0; + }else{ + match.strstart++; + match.match_length--; if (match.strstart >= match.orgstart) { bulk_insert_str(s, match.strstart, match.match_length); } |