diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-07 15:47:40 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-08 08:45:41 +0200 |
commit | 7764ae70b04058a64a3999529e98d1115ba59d1c (patch) | |
tree | 23a78251b97610b7a948ef776dfbcbc48aefbd8d /codemaker/source | |
parent | 37d5bf82eae7e6d611879d1132b1f6fdafdeb9ed (diff) |
clang bugprone-unused-return-value
most of these changes just make the change of ownership when using
std::unique_ptr clearer, but there is one definite leak fix in
PlainTextFilterDetect::detect
Change-Id: I8282a68007222a4fee84004f394bde0cca8569e9
Reviewed-on: https://gerrit.libreoffice.org/60159
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'codemaker/source')
-rw-r--r-- | codemaker/source/javamaker/javatype.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/codemaker/source/javamaker/javatype.cxx b/codemaker/source/javamaker/javatype.cxx index 5530392b278b..944f1a0aca9f 100644 --- a/codemaker/source/javamaker/javatype.cxx +++ b/codemaker/source/javamaker/javatype.cxx @@ -764,8 +764,7 @@ void handleEnumType( std::unique_ptr< ClassFile::Code > blockCode(cf->newCode()); blockCode->instrGetstatic(className, pair.second, classDescriptor); blockCode->instrAreturn(); - blocks.push_back(blockCode.get()); - blockCode.release(); + blocks.push_back(blockCode.release()); } code->instrTableswitch(defCode.get(), min, blocks); for (ClassFile::Code *p : blocks) @@ -783,8 +782,7 @@ void handleEnumType( std::unique_ptr< ClassFile::Code > blockCode(cf->newCode()); blockCode->instrGetstatic(className, pair.second, classDescriptor); blockCode->instrAreturn(); - blocks.emplace_back(pair.first, blockCode.get()); - blockCode.release(); + blocks.emplace_back(pair.first, blockCode.release()); } code->instrLookupswitch(defCode.get(), blocks); for (const std::pair< sal_Int32, ClassFile::Code * >& pair : blocks) |