Skip to content

Commit 203f88d

Browse files
committed
src: use direct initialzation and const string view signature
1 parent 3d1ff26 commit 203f88d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/node_sqlite.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "path.h"
1010
#include "sqlite3.h"
1111
#include "util-inl.h"
12+
#include "util.h"
1213

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

8081
DatabaseSync::DatabaseSync(Environment* env,
8182
Local<Object> object,
82-
std::string_view location,
83+
const std::string_view location,
8384
bool open)
8485
: BaseObject(env, object) {
8586
MakeWeak();
@@ -378,7 +379,7 @@ bool StatementSync::BindValue(const Local<Value>& value, const int index) {
378379
double val = value.As<Number>()->Value();
379380
r = sqlite3_bind_double(statement_, index, val);
380381
} else if (value->IsString()) {
381-
auto val = Utf8Value(env()->isolate(), value.As<String>());
382+
Utf8Value val(env()->isolate(), value.As<String>());
382383
r = sqlite3_bind_text(
383384
statement_, index, *val, val.length(), SQLITE_TRANSIENT);
384385
} else if (value->IsNull()) {

0 commit comments

Comments
 (0)