Skip to content

Commit 9c526b3

Browse files
committed
Avoids copy on the transformation operation
1 parent 8cfb289 commit 9c526b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+121
-87
lines changed

headers/modsecurity/actions/action.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class Action {
5757

5858
virtual ~Action() { }
5959

60-
virtual std::string evaluate(std::string exp,
60+
virtual std::string evaluate(const std::string &exp,
6161
Transaction *transaction);
6262
virtual bool evaluate(Rule *rule, Transaction *transaction);
6363
virtual bool evaluate(Rule *rule, Transaction *transaction,

src/actions/action.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace modsecurity {
4545
namespace actions {
4646

4747

48-
std::string Action::evaluate(std::string value,
48+
std::string Action::evaluate(const std::string &value,
4949
Transaction *transaction) {
5050
return value;
5151
}

src/actions/transformations/base64_decode.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace actions {
3232
namespace transformations {
3333

3434

35-
std::string Base64Decode::evaluate(std::string value,
35+
std::string Base64Decode::evaluate(const std::string &value,
3636
Transaction *transaction) {
3737
std::string ret = Utils::Base64::decode(value);
3838

src/actions/transformations/base64_decode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Base64Decode : public Transformation {
3232
public:
3333
explicit Base64Decode(const std::string &action) : Transformation(action) { }
3434

35-
std::string evaluate(std::string exp,
35+
std::string evaluate(const std::string &exp,
3636
Transaction *transaction) override;
3737
};
3838

src/actions/transformations/base64_decode_ext.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace actions {
3232
namespace transformations {
3333

3434

35-
std::string Base64DecodeExt::evaluate(std::string value,
35+
std::string Base64DecodeExt::evaluate(const std::string &value,
3636
Transaction *transaction) {
3737
std::string ret = Utils::Base64::decode_forgiven(value);
3838

src/actions/transformations/base64_decode_ext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Base64DecodeExt : public Transformation {
3232
public:
3333
explicit Base64DecodeExt(const std::string &action) : Transformation(action) { }
3434

35-
std::string evaluate(std::string exp,
35+
std::string evaluate(const std::string &exp,
3636
Transaction *transaction) override;
3737
};
3838

src/actions/transformations/base64_encode.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace actions {
3232
namespace transformations {
3333

3434

35-
std::string Base64Encode::evaluate(std::string value,
35+
std::string Base64Encode::evaluate(const std::string &value,
3636
Transaction *transaction) {
3737
std::string ret = Utils::Base64::encode(value);
3838

src/actions/transformations/base64_encode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Base64Encode : public Transformation {
3232
public:
3333
explicit Base64Encode(const std::string &action) : Transformation(action) { }
3434

35-
std::string evaluate(std::string exp,
35+
std::string evaluate(const std::string &exp,
3636
Transaction *transaction) override;
3737
};
3838

src/actions/transformations/cmd_line.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace actions {
3131
namespace transformations {
3232

3333

34-
std::string CmdLine::evaluate(std::string value,
34+
std::string CmdLine::evaluate(const std::string &value,
3535
Transaction *transaction) {
3636
std::string ret;
3737
int space = 0;

src/actions/transformations/cmd_line.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class CmdLine : public Transformation {
3333
explicit CmdLine(const std::string &action)
3434
: Transformation(action) { }
3535

36-
std::string evaluate(std::string exp,
36+
std::string evaluate(const std::string &exp,
3737
Transaction *transaction) override;
3838
};
3939

0 commit comments

Comments
 (0)