Content-Length: 4233 | pFad | http://github.com/postgrespro/libblobstamper/pull/9.diff
thub.com
diff --git a/blobstamper/stamp_enumerator.cpp b/blobstamper/stamp_enumerator.cpp
index 8e1146c..ea12be6 100644
--- a/blobstamper/stamp_enumerator.cpp
+++ b/blobstamper/stamp_enumerator.cpp
@@ -26,10 +26,10 @@
std::string StampStrEnumerator::ExtractStr(std::shared_ptr blob)
{
- std::vector data = ExtractStrVector(blob);
+ const std::vector &data = ExtractStrVector(blob);
std::string res = "";
- for (std::string s : data)
+ for (const std::string &s : data)
{
if (!res.empty())
{
diff --git a/blobstamper/stamp_json.cpp b/blobstamper/stamp_json.cpp
index 0fb5d2d..ec86029 100644
--- a/blobstamper/stamp_json.cpp
+++ b/blobstamper/stamp_json.cpp
@@ -27,7 +27,7 @@
PoolPickerStamp::PoolPickerStamp(std::vector> new_pool)
: pool{new_pool}
{
- for (auto stamp : pool)
+ for (const auto &stamp : pool)
{
std::weak_ptr wp = stamp;
weak_pool.push_back(wp);
@@ -40,7 +40,7 @@ PoolPickerStamp::isRecursive()
if (is_recursive || is_in_recursion)
return true;
is_in_recursion = true;
- for (auto stamp : weak_pool)
+ for (const auto &stamp : weak_pool)
{
if (stamp.lock()->isRecursive())
{
@@ -62,7 +62,7 @@ PoolPickerStamp::ExtractStr(std::shared_ptr blob)
std::vector> target_pool;
std::vector> unbounded_pool;
- for (auto stamp_w : weak_pool)
+ for (const auto &stamp_w : weak_pool)
{
auto stamp = stamp_w.lock();
if (stamp->minSize() <= blob->Size())
@@ -91,7 +91,7 @@ PoolPickerStamp::minSize()
if (is_in_recursion)
return res;
is_in_recursion = true; /* Do not use isRecursive() inside as it uses same flag*/
- for(auto stamp : weak_pool)
+ for (const auto &stamp : weak_pool)
{
int candidat = stamp.lock()->minSize();
if (res > candidat)
@@ -111,7 +111,7 @@ PoolPickerStamp::maxSize()
if (is_recursive || is_in_recursion)
return -1;
is_in_recursion = true; /* Do not use isRecursive() inside as it uses same flag*/
- for (auto stamp : weak_pool)
+ for (const auto &stamp : weak_pool)
{
int candidat = stamp.lock()->maxSize();
if (candidat == -1)
@@ -144,8 +144,8 @@ StampJSONString::ExtractStr(std::shared_ptr blob)
std::string
StampJSONHashEl::ExtractStr(std::shared_ptr blob)
{
- std::string n = stamp_name->ExtractStr(blob);
- std::string v = stamp_value->ExtractStr(blob);
+ const std::string &n = stamp_name->ExtractStr(blob);
+ const std::string &v = stamp_value->ExtractStr(blob);
return n + ": " + v;
}
diff --git a/blobstamper/stamp_math_op.cpp b/blobstamper/stamp_math_op.cpp
index 50ef4a6..7987f22 100644
--- a/blobstamper/stamp_math_op.cpp
+++ b/blobstamper/stamp_math_op.cpp
@@ -29,7 +29,7 @@ StampMathUnaryOp::ExtractStr(std::shared_ptr blob)
std::string
StampMathBinaryOp::ExtractStr(std::shared_ptr blob)
{
- std::vector> blobs = extract_internal(blob);
+ const std::vector> &blobs = extract_internal(blob);
return (std::string)"(" + stamp1->ExtractStr(blobs[0]) + " " + op_name + " " + stamp2->ExtractStr(blobs[1]) + ")";
}
diff --git a/blobstamper/stamp_text.cpp b/blobstamper/stamp_text.cpp
index cadddfd..040b370 100644
--- a/blobstamper/stamp_text.cpp
+++ b/blobstamper/stamp_text.cpp
@@ -38,10 +38,10 @@ StampTextPulp::ExtractStr(std::shared_ptr blob)
std::string StampTextPulpWords::ExtractStr(std::shared_ptr blob)
{
- std::vector data = ExtractStrVector(blob);
+ const std::vector &data = ExtractStrVector(blob);
std::string res = "";
- for(std::string s : data)
+ for (const std::string &s : data)
{
if (!res.empty())
{
@@ -54,10 +54,10 @@ std::string StampTextPulpWords::ExtractStr(std::shared_ptr blob)
std::string StampTextDictWords::ExtractStr(std::shared_ptr blob)
{
- std::vector data = ExtractStrVector(blob);
+ const std::vector &data = ExtractStrVector(blob);
std::string res = "";
- for(std::string s : data)
+ for (const std::string &s : data)
{
if (!res.empty())
{
--- a PPN by Garber Painting Akron. With Image Size Reduction included!Fetched URL: http://github.com/postgrespro/libblobstamper/pull/9.diff
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy