go-sqlite3 icon indicating copy to clipboard operation
go-sqlite3 copied to clipboard

sqlite3: don't copy string in bind()

Open charlievieth opened this issue 2 years ago • 1 comments

Change bind() to pass sqlite3_bind_text() a pointer to the strings data instead of converting it to a []byte just so a pointer to &b[0] can be passed to unsafe.Pointer. Basically, this saves a needless allocation. and passing a pointer to that.

This is safe because sqlite3_bind_text does not keep a copy of the provided string.

charlievieth avatar Apr 21 '23 03:04 charlievieth

:warning: 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 :white_check_mark:

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

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

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1158   +/-   ##
=======================================
  Coverage   47.16%   47.16%           
=======================================
  Files          12       12           
  Lines        1533     1533           
=======================================
  Hits          723      723           
  Misses        669      669           
  Partials      141      141           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Apr 21 '23 03:04 codecov-commenter