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

perf: avoid unnecessary byte/string conversion #1541

Merged
merged 1 commit into from
May 22, 2023
Merged

perf: avoid unnecessary byte/string conversion #1541

merged 1 commit into from
May 22, 2023

Conversation

Juneezee
Copy link
Contributor

PR Details

We can use alternative functions/methods to avoid unnecessary byte/string conversion calls.

Description

  1. (*Builder).WriteString(string(<a byte>)) -> (*Builder).WriteByte(<a byte>)
  2. (*Regexp).Match([]byte(<a string>)) -> (*Regexp).MatchString(<a string>)

Related Issue

Motivation and Context

How Has This Been Tested

go test ./...
ok  	github.com/xuri/excelize/v2	63.499s

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

We can use alternative functions/methods to avoid unnecessary
byte/string conversion calls.

Signed-off-by: Eng Zer Jun <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented May 20, 2023

Codecov Report

Merging #1541 (f0b8454) into master (a246db6) will not change coverage.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff           @@
##           master    #1541   +/-   ##
=======================================
  Coverage   98.82%   98.82%           
=======================================
  Files          31       31           
  Lines       24494    24494           
=======================================
  Hits        24206    24206           
  Misses        191      191           
  Partials       97       97           
Flag Coverage Δ
unittests 98.82% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
numfmt.go 100.00% <100.00%> (ø)
table.go 99.15% <100.00%> (ø)

@xuri xuri added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 21, 2023
Copy link
Member

@xuri xuri left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you very much.

@xuri xuri merged commit c232748 into qax-os:master May 22, 2023
xuri pushed a commit to JDavidVR/excelize that referenced this pull request Jul 11, 2023
jenbonzhang pushed a commit to jenbonzhang/excelize that referenced this pull request Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants