From 486436f5e7d414a7512fadab91f42af3651485be Mon Sep 17 00:00:00 2001 From: Volker Birk Date: Thu, 1 Sep 2016 12:41:22 +0100 Subject: [PATCH] avoid duplication --- src/message_api.cc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/message_api.cc b/src/message_api.cc index 728ca71..d9ef9c6 100644 --- a/src/message_api.cc +++ b/src/message_api.cc @@ -50,12 +50,7 @@ namespace pEp { int rating = (int) _rating; int flags = (int) _flags; - if (!_dst) - _dst = ::message_dup(_src); - if (!_dst) - throw bad_alloc(); - - Message dst(_dst); + Message dst = _dst ? Message(_dst) : Message(src); return boost::python::make_tuple(dst, keylist, rating, flags); }