Skip to content

Commit fde9d27

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

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
@@ -44,12 +44,10 @@ functionStatic:src/engine/lua.h:71
4444
functionConst:src/utils/geo_lookup.h:49
4545
useInitializationList:src/operators/rbl.h:69
4646
constStatement:test/common/modsecurity_test.cc:82
47-
danglingTemporaryLifetime:src/modsecurity.cc:206
4847
functionStatic:src/operators/geo_lookup.h:35
4948
duplicateBreak:src/operators/validate_utf8_encoding.cc
5049
syntaxError:src/transaction.cc:62
5150
noConstructor:src/variables/variable.h:152
52-
danglingTempReference:src/modsecurity.cc:206
5351
knownConditionTrueFalse:src/operators/validate_url_encoding.cc:77
5452
knownConditionTrueFalse:src/operators/verify_svnr.cc:87
5553
rethrowNoCurrentException:headers/modsecurity/transaction.h:313

0 commit comments

Comments
 (0)