From 9326e63440b08f877302a87afbe1ef82d5cd2c76 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Tue, 28 Feb 2023 09:24:05 -0400 Subject: PSOV3Encryption: Make `update_stream()` a lot cleaner --- src/pso/PSOV3Encryption.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pso/PSOV3Encryption.cpp b/src/pso/PSOV3Encryption.cpp index 30c5586..38225bf 100644 --- a/src/pso/PSOV3Encryption.cpp +++ b/src/pso/PSOV3Encryption.cpp @@ -13,17 +13,17 @@ u32 PSOV3Encryption::next() { void PSOV3Encryption::update_stream() { u32 *ptr; - u32 *first_end; - u32 *start; + u32 *part1; + u32 *part2; - start = m_buffer.start(); + part2 = m_buffer.start(); m_buffer_start = m_buffer.start(); + ptr = m_buffer.start(); + part1 = &ptr[489]; - for (ptr = m_buffer.start(), first_end = &ptr[489]; first_end != m_buffer_end;) { - *ptr++ ^= *first_end++; - } + for (; part1 != m_buffer_end; *ptr++ ^= *part1++); + for (; ptr != m_buffer_end; *ptr++ ^= *part2++); - for (u32 *p = ptr; p != m_buffer_end; *p++ ^= *start++); } void PSOV3Encryption::init(u32 seed) { -- cgit v1.2.3-13-gbd6f