diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-07-03 23:23:22 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-07-03 23:23:22 +0900 |
| commit | 7e6db8d801973bfc62b80f411f14d1d332a1f7aa (patch) | |
| tree | 9ace3886df397907d113b97ec132e64f6729ea02 /src/MessageDigest.cc | |
| parent | df0034f1cd5a3c642fba65f228da7ca0674161b8 (diff) | |
Use std::unique_ptr instead of array_ptr
Diffstat (limited to 'src/MessageDigest.cc')
| -rw-r--r-- | src/MessageDigest.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/MessageDigest.cc b/src/MessageDigest.cc index 01189c7f..725c56c8 100644 --- a/src/MessageDigest.cc +++ b/src/MessageDigest.cc @@ -186,10 +186,9 @@ void MessageDigest::digest(unsigned char* md) std::string MessageDigest::digest() { size_t length = pImpl_->getDigestLength(); - array_ptr<unsigned char> buf(new unsigned char[length]); - pImpl_->digest(buf); - std::string hd(&buf[0], &buf[length]); - return hd; + auto buf = make_unique<unsigned char[]>(length); + pImpl_->digest(buf.get()); + return std::string(&buf[0], &buf[length]); } } // namespace aria2 |
