Skip to content

archive/tar: narrow trim range for formatter'formatString #60729

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

Closed
wants to merge 2 commits into from
Closed

archive/tar: narrow trim range for formatter'formatString #60729

wants to merge 2 commits into from

Conversation

callthingsoff
Copy link
Contributor

@callthingsoff callthingsoff commented Jun 11, 2023

Trim s[:len(b)-1] rather than s[:len(b)], since s[len(b)-1] is '/'.

When dealing with the last special case,
we only need to know the string length after TrimRight '/'.
This optimization clarifies what we really want and speeds up the execution.
@gopherbot
Copy link
Contributor

This PR (HEAD: 34a6028) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/502376 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/502376.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Sense As:

Patch Set 1:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/502376.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/502376.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Joseph Tsai:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/502376.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Sense As:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/502376.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Sense As:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/502376.
After addressing review feedback, remember to publish your drafts!

Trim s[:len(b)-1] rather than s[:len(b)], since s[len(b)-1] is '/'.
@callthingsoff callthingsoff changed the title archive/tar: optimize formatter's formatString archive/tar: narrow trim range for formatter'formatString Jun 12, 2023
@gopherbot
Copy link
Contributor

This PR (HEAD: 4579775) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/502376 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 2: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/502376.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/502376.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 2: TryBot-Result+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/502376.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/502376.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Sense As:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/502376.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 2: Auto-Submit+1 Code-Review+2 Run-TryBot+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/502376.
After addressing review feedback, remember to publish your drafts!

gopherbot pushed a commit that referenced this pull request Aug 1, 2023
Trim s[:len(b)-1] rather than s[:len(b)], since s[len(b)-1] is '/'.

Change-Id: I055da555810c112774549bd13d4faa8bfa0a60dc
GitHub-Last-Rev: 4579775
GitHub-Pull-Request: #60729
Reviewed-on: https://go-review.googlesource.com/c/go/+/502376
Run-TryBot: Ian Lance Taylor <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Run-TryBot: Ian Lance Taylor <[email protected]>
Auto-Submit: Ian Lance Taylor <[email protected]>
Reviewed-by: David Chase <[email protected]>
@gopherbot
Copy link
Contributor

This PR is being closed because golang.org/cl/502376 has been merged.

@gopherbot gopherbot closed this Aug 1, 2023
@callthingsoff callthingsoff deleted the format_string branch August 1, 2023 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants