Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix toString function defect #345

Merged
merged 4 commits into from
May 13, 2019
Merged

fix toString function defect #345

merged 4 commits into from
May 13, 2019

Conversation

ayyt
Copy link
Contributor

@ayyt ayyt commented May 8, 2019

fix toString function defect

@nebula-community-bot
Copy link
Member

Can one of the admins verify this patch?

buf += "] ";
buf += columnTypeToString(item.type_);
buf += ",";
std::string propItemStr = item.name_;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before you do append string, reserve enough space will be more efficient.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad. I just tested it on my machine, by default, the capacity of empty string is fifteen.
👍

@ayyt
Copy link
Contributor Author

ayyt commented May 9, 2019

Fix comments, please review again, thx.

Copy link
Contributor

@dutor dutor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are making things neither simpler nor more performant.

If you already have an collection of strings to be joined, using folly:join is reasonable since it's more concise. Otherwise, if you collect them manually first, you introduce additional copy movements, which is way too inefficient.

My opinion is to review all of the resizes to guarantee they are doing correctly.

@ayyt
Copy link
Contributor Author

ayyt commented May 13, 2019

fix and rebase master, please review, thx.

dutor
dutor previously approved these changes May 13, 2019
Copy link
Contributor

@dutor dutor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Thanks for this enhancing job!

@dutor dutor added the ready-for-testing PR: ready for the CI test label May 13, 2019
@dutor
Copy link
Contributor

dutor commented May 13, 2019

Jenkins, go!

@nebula-community-bot
Copy link
Member

Unit testing passed.

@dutor dutor merged commit cba6eed into vesoft-inc:master May 13, 2019
@dutor dutor deleted the fix_defect branch May 13, 2019 07:13
yixinglu pushed a commit to yixinglu/nebula that referenced this pull request Feb 16, 2020
…-inc#345)

* fix toString function defect

* address dangleptr's comments

* address dutor's comments
tong-hao pushed a commit to tong-hao/nebula that referenced this pull request Jun 1, 2021
…-inc#345)

* fix toString function defect

* address dangleptr's comments

* address dutor's comments
yixinglu added a commit to yixinglu/nebula that referenced this pull request Mar 21, 2022
* feat - support chinese

* fix - remove debug anno

* support `chinese`

* add test cases

* fix encode bug

Co-authored-by: cpw <[email protected]>
Co-authored-by: Yee <[email protected]>
Co-authored-by: Sophie <[email protected]>

Co-authored-by: endy.li <[email protected]>
Co-authored-by: cpw <[email protected]>
Co-authored-by: Yee <[email protected]>
Co-authored-by: Sophie <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants