aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/Pl_LZWDecoder.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf/Pl_LZWDecoder.cc')
-rw-r--r--libqpdf/Pl_LZWDecoder.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/libqpdf/Pl_LZWDecoder.cc b/libqpdf/Pl_LZWDecoder.cc
index 8e5fd9d1..9abb69cd 100644
--- a/libqpdf/Pl_LZWDecoder.cc
+++ b/libqpdf/Pl_LZWDecoder.cc
@@ -129,7 +129,7 @@ Pl_LZWDecoder::addToTable(unsigned char next)
unsigned char* new_data = entry.getBuffer();
memcpy(new_data, last_data, last_size);
new_data[last_size] = next;
- this->table.push_back(entry);
+ this->table.push_back(std::move(entry));
}
void
@@ -149,9 +149,8 @@ Pl_LZWDecoder::handleCode(unsigned int code)
this->eod = true;
} else {
if (this->last_code != 256) {
- // Add to the table from last time. New table entry would
- // be what we read last plus the first character of what
- // we're reading now.
+ // Add to the table from last time. New table entry would be what we read last plus the
+ // first character of what we're reading now.
unsigned char next = '\0';
unsigned int table_size = QIntC::to_uint(table.size());
if (code < 256) {
@@ -162,10 +161,8 @@ Pl_LZWDecoder::handleCode(unsigned int code)
if (idx > table_size) {
throw std::runtime_error("LZWDecoder: bad code received");
} else if (idx == table_size) {
- // The encoder would have just created this entry,
- // so the first character of this entry would have
- // been the same as the first character of the
- // last entry.
+ // The encoder would have just created this entry, so the first character of
+ // this entry would have been the same as the first character of the last entry.
QTC::TC("libtests", "Pl_LZWDecoder last was table size");
next = getFirstChar(this->last_code);
} else {