Closed Bug 848770 Opened 8 years ago Closed 8 years ago

Choose the best compression settings automagically for seekable zstreams (szip)

Categories

(Core :: mozglue, defect)

All
Android
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(2 files)

No description provided.
Blocks: 848764
Comment on attachment 723419 [details] [diff] [review]
Choose the best compression settings automagically for seekable zstreams (szip)

Review of attachment 723419 [details] [diff] [review]:
-----------------------------------------------------------------

Looks sane too me.

::: mozglue/linker/szip.cpp
@@ +274,5 @@
> +    if (do_compress(*origData, tmpBuf, NULL, 0, f) == 0) {
> +      if (tmpBuf.GetLength() < outBuf.GetLength()) {
> +        outBuf.Resize(tmpBuf.GetLength());
> +        memcpy(static_cast<void *>(outBuf), static_cast<void *>(tmpBuf),
> +               tmpBuf.GetLength());

Factoring out this .Resize/memcpy idiom (a method in Buffer?) would be a good thing.  You could use it in FilteredBuffer and several places in this function.  (Maybe other places in this file, I didn't check.)
Attachment #723419 - Flags: review?(nfroyd) → review+
Attachment #723860 - Flags: review?(nfroyd)
Attachment #723860 - Flags: review?(nfroyd) → review+
https://hg.mozilla.org/mozilla-central/rev/80944f366642
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.