Skip to content

Commit

Permalink
src: use direct initialzation and const string view signature
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasBa committed Aug 22, 2024
1 parent 3d1ff26 commit 203f88d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/node_sqlite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "path.h"
#include "sqlite3.h"
#include "util-inl.h"
#include "util.h"

#include <cinttypes>
#include <string_view>
Expand Down Expand Up @@ -79,7 +80,7 @@ inline void THROW_ERR_SQLITE_ERROR(Isolate* isolate, sqlite3* db) {

DatabaseSync::DatabaseSync(Environment* env,
Local<Object> object,
std::string_view location,
const std::string_view location,
bool open)
: BaseObject(env, object) {
MakeWeak();
Expand Down Expand Up @@ -378,7 +379,7 @@ bool StatementSync::BindValue(const Local<Value>& value, const int index) {
double val = value.As<Number>()->Value();
r = sqlite3_bind_double(statement_, index, val);
} else if (value->IsString()) {
auto val = Utf8Value(env()->isolate(), value.As<String>());
Utf8Value val(env()->isolate(), value.As<String>());
r = sqlite3_bind_text(
statement_, index, *val, val.length(), SQLITE_TRANSIENT);
} else if (value->IsNull()) {
Expand Down

0 comments on commit 203f88d

Please sign in to comment.