aboutsummaryrefslogtreecommitdiffstats
path: root/libtests/rc4.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-02-05 14:15:07 +0100
committerJay Berkenbilt <ejb@ql.org>2022-02-05 17:24:56 +0100
commit5f3f78822b5d43e9b02082da5268d186ba7101c0 (patch)
treec7d2407df01e4c622371ad290f9681a5ae99a476 /libtests/rc4.cc
parent88c3d556d552a94aa42eaa2fa43667952e123dc8 (diff)
downloadqpdf-5f3f78822b5d43e9b02082da5268d186ba7101c0.tar.zst
Improve use of std::unique_ptr
* Use unique_ptr in place of shared_ptr in some cases * unique_ptr for arrays does not require a custom deleter * use std::make_unique (c++14) where possible
Diffstat (limited to 'libtests/rc4.cc')
-rw-r--r--libtests/rc4.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/libtests/rc4.cc b/libtests/rc4.cc
index d3f1c7fa..b8abce88 100644
--- a/libtests/rc4.cc
+++ b/libtests/rc4.cc
@@ -14,8 +14,7 @@ static void other_tests()
// Test cases not covered by the pipeline: string as key, convert
// in place
RC4 r(reinterpret_cast<unsigned char const*>("quack"));
- auto data = std::unique_ptr<unsigned char[]>(
- new unsigned char[6], std::default_delete<unsigned char[]>());
+ auto data = std::make_unique<unsigned char[]>(6);
memcpy(data.get(), "potato", 6);
r.process(data.get(), 6);
assert(memcmp(data.get(), "\xa5\x6f\xe7\x27\x2b\x5c", 6) == 0);