Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

replaced with constant references to avoid copying#9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ProjectMutilation wants to merge1 commit intopostgrespro:master
base:master
Choose a base branch
Loading
fromProjectMutilation:avoid-copy-init
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletionsblobstamper/stamp_enumerator.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,10 +26,10 @@

std::string StampStrEnumerator::ExtractStr(std::shared_ptr<Blob> blob)
{
std::vector<std::string> data = ExtractStrVector(blob);
conststd::vector<std::string>&data = ExtractStrVector(blob);
std::string res = "";

for (std::string s : data)
for (conststd::string&s : data)
{
if (!res.empty())
{
Expand Down
14 changes: 7 additions & 7 deletionsblobstamper/stamp_json.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -27,7 +27,7 @@
PoolPickerStamp::PoolPickerStamp(std::vector<std::shared_ptr<StampBaseStr>> new_pool)
: pool{new_pool}
{
for (auto stamp : pool)
for (constauto&stamp : pool)
{
std::weak_ptr<StampBaseStr> wp = stamp;
weak_pool.push_back(wp);
Expand All@@ -40,7 +40,7 @@ PoolPickerStamp::isRecursive()
if (is_recursive || is_in_recursion)
return true;
is_in_recursion = true;
for (auto stamp : weak_pool)
for (constauto&stamp : weak_pool)
{
if (stamp.lock()->isRecursive())
{
Expand All@@ -62,7 +62,7 @@ PoolPickerStamp::ExtractStr(std::shared_ptr<Blob> blob)
std::vector<std::weak_ptr<StampBaseStr>> target_pool;
std::vector<std::weak_ptr<StampBaseStr>> unbounded_pool;

for (auto stamp_w : weak_pool)
for (constauto&stamp_w : weak_pool)
{
auto stamp = stamp_w.lock();
if (stamp->minSize() <= blob->Size())
Expand DownExpand Up@@ -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 (constauto&stamp : weak_pool)
{
int candidat = stamp.lock()->minSize();
if (res > candidat)
Expand All@@ -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 (constauto&stamp : weak_pool)
{
int candidat = stamp.lock()->maxSize();
if (candidat == -1)
Expand DownExpand Up@@ -144,8 +144,8 @@ StampJSONString::ExtractStr(std::shared_ptr<Blob> blob)
std::string
StampJSONHashEl::ExtractStr(std::shared_ptr<Blob> blob)
{
std::string n = stamp_name->ExtractStr(blob);
std::string v = stamp_value->ExtractStr(blob);
conststd::string&n = stamp_name->ExtractStr(blob);
conststd::string&v = stamp_value->ExtractStr(blob);
return n + ": " + v;
}

Expand Down
2 changes: 1 addition & 1 deletionblobstamper/stamp_math_op.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,7 +29,7 @@ StampMathUnaryOp::ExtractStr(std::shared_ptr<Blob> blob)
std::string
StampMathBinaryOp::ExtractStr(std::shared_ptr<Blob> blob)
{
std::vector<std::shared_ptr<Blob>> blobs = extract_internal(blob);
conststd::vector<std::shared_ptr<Blob>>&blobs = extract_internal(blob);
return (std::string)"(" + stamp1->ExtractStr(blobs[0]) + " " + op_name + " " + stamp2->ExtractStr(blobs[1]) + ")";
}

8 changes: 4 additions & 4 deletionsblobstamper/stamp_text.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -38,10 +38,10 @@ StampTextPulp::ExtractStr(std::shared_ptr<Blob> blob)

std::string StampTextPulpWords::ExtractStr(std::shared_ptr<Blob> blob)
{
std::vector<std::string> data = ExtractStrVector(blob);
conststd::vector<std::string>&data = ExtractStrVector(blob);
std::string res = "";

for(std::string s : data)
for (conststd::string&s : data)
{
if (!res.empty())
{
Expand All@@ -54,10 +54,10 @@ std::string StampTextPulpWords::ExtractStr(std::shared_ptr<Blob> blob)

std::string StampTextDictWords::ExtractStr(std::shared_ptr<Blob> blob)
{
std::vector<std::string> data = ExtractStrVector(blob);
conststd::vector<std::string>&data = ExtractStrVector(blob);
std::string res = "";

for(std::string s : data)
for (conststd::string&s : data)
{
if (!res.empty())
{
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp