diff options
author | Jack Lloyd <[email protected]> | 2019-07-05 19:20:53 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-07-05 19:20:53 -0400 |
commit | bab50f163ef4449725dc15b5acbcab2ad177b18c (patch) | |
tree | 72b3e42c7d368cad6262e057aa9a572ada0405ea | |
parent | e15d1c2b72102a2e01aff0e344f023753407ccfb (diff) |
Avoid pointless write
The last 4 bytes are always overwritten in this loop.
-rw-r--r-- | src/lib/stream/ctr/ctr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/stream/ctr/ctr.cpp b/src/lib/stream/ctr/ctr.cpp index 219d8042c..f1d8d97b8 100644 --- a/src/lib/stream/ctr/ctr.cpp +++ b/src/lib/stream/ctr/ctr.cpp @@ -216,7 +216,7 @@ void CTR_BE::seek(uint64_t offset) const uint32_t low32 = load_be<uint32_t>(&m_counter[BS-4], 0); for(size_t i = 1; i != m_ctr_blocks; ++i) { - copy_mem(&m_counter[i*BS], &m_counter[0], BS); + copy_mem(&m_counter[i*BS], &m_counter[0], BS - 4); const uint32_t c = static_cast<uint32_t>(low32 + i); store_be(c, &m_counter[(BS-4)+i*BS]); } |