Skip to content

Commit 30e1cd8

Browse files
committed
Removed unnecessary cppcheck suppression and r-value reference as copy should be avoidded by RVO
1 parent cc24a4f commit 30e1cd8

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

src/modsecurity.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ void ModSecurity::serverLog(void *data, std::shared_ptr<RuleMessage> rm) {
202202
}
203203

204204
if (m_logProperties & TextLogProperty) {
205-
std::string &&d = rm->log();
205+
auto d = rm->log();
206206
const void *a = static_cast<const void *>(d.c_str());
207207
m_logCb(data, a);
208208
return;

test/cppcheck_suppressions.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,10 @@ functionStatic:src/engine/lua.h:71
4343
functionConst:src/utils/geo_lookup.h:49
4444
useInitializationList:src/operators/rbl.h:73
4545
constStatement:test/common/modsecurity_test.cc:82
46-
danglingTemporaryLifetime:src/modsecurity.cc:206
4746
functionStatic:src/operators/geo_lookup.h:35
4847
duplicateBreak:src/operators/validate_utf8_encoding.cc
4948
syntaxError:src/transaction.cc:65
5049
noConstructor:src/variables/variable.h:152
51-
danglingTempReference:src/modsecurity.cc:206
5250
knownConditionTrueFalse:src/operators/validate_url_encoding.cc:77
5351
knownConditionTrueFalse:src/operators/verify_svnr.cc:87
5452
rethrowNoCurrentException:headers/modsecurity/transaction.h:313

0 commit comments

Comments
 (0)