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

Implement tuple_type_impl::to_string_impl. #4645

Merged
merged 1 commit into from Jul 3, 2019

Conversation

@kbr-
Copy link
Contributor

commented Jul 3, 2019

Resolves #4633 (tuple_type was the only type for which to_string wasn't implemented yet).

@kbr-

This comment has been minimized.

Copy link
Contributor Author

commented Jul 3, 2019

@tgrabiec could you please review?

types.cc Outdated
static std::string escape(sstring_view s) {
static thread_local std::regex colon_re(":");
static thread_local std::regex at_re("@");
std::string result(s);

This comment has been minimized.

Copy link
@avikivity

avikivity Jul 3, 2019

Contributor

No need for thread_local since it's not mutable (can add const to stress that).

This comment has been minimized.

Copy link
@kbr-

kbr- Jul 3, 2019

Author Contributor

Done.

types.cc Outdated
std::string result(s);
result = std::regex_replace(result, colon_re, "\\:");
result = std::regex_replace(result, at_re, "\\@");
return result;

This comment has been minimized.

Copy link
@avikivity

avikivity Jul 3, 2019

Contributor

Can do a single pass with "[@:]" and "\$1"

This comment has been minimized.

Copy link
@kbr-

kbr- Jul 3, 2019

Author Contributor

Thanks. I've also changed the 'unescape' function.

Resolves #4633.

Signed-off-by: Kamil Braun <kbraun@scylladb.com>
@kbr- kbr- force-pushed the kbr-:tostring branch from d013be9 to 9b51e41 Jul 3, 2019
@avikivity avikivity changed the base branch from master to next Jul 3, 2019
@avikivity avikivity merged commit 6216779 into scylladb:next Jul 3, 2019
avikivity added a commit that referenced this pull request Jul 4, 2019
Resolves #4633.

Signed-off-by: Kamil Braun <kbraun@scylladb.com>
avikivity added a commit that referenced this pull request Jul 6, 2019
Resolves #4633.

Signed-off-by: Kamil Braun <kbraun@scylladb.com>
avikivity added a commit that referenced this pull request Jul 8, 2019
Resolves #4633.

Signed-off-by: Kamil Braun <kbraun@scylladb.com>
(cherry picked from commit 8995945)
avikivity added a commit that referenced this pull request Jul 8, 2019
Resolves #4633.

Signed-off-by: Kamil Braun <kbraun@scylladb.com>
(cherry picked from commit 8995945)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.