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

sqlite3: save an alloc during bind by using time.Time.AppendFormat #1157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

charlievieth
Copy link
Contributor

This commit changes bind() to use time.Time.AppendFormat, which returns a byte slice, instead of time.Time.Format, which returns a string that must then be converted to a byte slice. This should save an allocation.

@codecov-commenter
Copy link

codecov-commenter commented Apr 21, 2023

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 47.19%. Comparing base (18cdded) to head (6c06c86).
Report is 1 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1157      +/-   ##
==========================================
+ Coverage   47.16%   47.19%   +0.03%     
==========================================
  Files          12       12              
  Lines        1533     1534       +1     
==========================================
+ Hits          723      724       +1     
  Misses        669      669              
  Partials      141      141              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dolmen
Copy link
Contributor

dolmen commented Oct 17, 2023

Note: time.Time.AppendFormat has been added with Go 1.5.

@charlievieth
Copy link
Contributor Author

@dolmen Any chance you could take another look at this PR?

This commit changes bind() to use time.Time.AppendFormat, which returns
a byte slice, instead of time.Time.Format, which returns a string that
must then be converted to a byte slice. This should save an allocation.
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.

3 participants