summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsnappy.mirrorbot@gmail.com <snappy.mirrorbot@gmail.com@03e5f5b5-db94-4691-08a0-1a8bf15f6143>2011-06-02 18:06:54 +0000
committersnappy.mirrorbot@gmail.com <snappy.mirrorbot@gmail.com@03e5f5b5-db94-4691-08a0-1a8bf15f6143>2011-06-02 18:06:54 +0000
commite3d46d704bcfc0129fd4ec9cf3f9147a0546da20 (patch)
tree9c8d064feda73f3eb3a13b4c498253d356c67201
parentf56157f8b866453cf9096aacbffc629550482cd6 (diff)
downloadsnappy-e3d46d704bcfc0129fd4ec9cf3f9147a0546da20.tar.gz
Remove an unneeded goto in the decompressor; it turns out that the
state of ip_ after decompression (or attempted decompresion) is completely irrelevant, so we don't need the trailer. Performance is, as expected, mostly flat -- there's a curious ~3-5% loss in the "lsp" test, but that test case is so short it is hard to say anything definitive about why (most likely, it's some sort of unrelated effect). R=jeff git-svn-id: http://snappy.googlecode.com/svn/trunk@39 03e5f5b5-db94-4691-08a0-1a8bf15f6143
-rw-r--r--snappy.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/snappy.cc b/snappy.cc
index b3045a3..a591aba 100644
--- a/snappy.cc
+++ b/snappy.cc
@@ -673,19 +673,19 @@ class SnappyDecompressor {
uint32 avail = ip_limit_ - ip;
while (avail < literal_length) {
bool allow_fast_path = (avail >= 16);
- if (!writer->Append(ip, avail, allow_fast_path)) goto end;
+ if (!writer->Append(ip, avail, allow_fast_path)) return;
literal_length -= avail;
reader_->Skip(peeked_);
size_t n;
ip = reader_->Peek(&n);
avail = n;
peeked_ = avail;
- if (avail == 0) goto end; // Premature end of input
+ if (avail == 0) return; // Premature end of input
ip_limit_ = ip + avail;
}
bool allow_fast_path = (avail >= 16);
if (!writer->Append(ip, literal_length, allow_fast_path)) {
- goto end;
+ return;
}
ip += literal_length;
} else {
@@ -694,13 +694,10 @@ class SnappyDecompressor {
// bit 8).
const uint32 copy_offset = entry & 0x700;
if (!writer->AppendFromSelf(copy_offset + trailer, length)) {
- goto end;
+ return;
}
}
}
-
-end:
- ip_ = ip;
}
};