Skip to content

Commit 5a3c605

Browse files
authored
sqlite: remove unnecessary auto assignment
Assignment is not necessary here at all. PR-URL: #54686 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
1 parent fff1549 commit 5a3c605

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/node_sqlite.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ void DatabaseSync::Prepare(const FunctionCallbackInfo<Value>& args) {
213213
return;
214214
}
215215

216-
auto sql = node::Utf8Value(env->isolate(), args[0].As<String>());
216+
node::Utf8Value sql(env->isolate(), args[0].As<String>());
217217
sqlite3_stmt* s = nullptr;
218218
int r = sqlite3_prepare_v2(db->connection_, *sql, -1, &s, 0);
219219
CHECK_ERROR_OR_THROW(env->isolate(), db->connection_, r, SQLITE_OK, void());
@@ -234,7 +234,7 @@ void DatabaseSync::Exec(const FunctionCallbackInfo<Value>& args) {
234234
return;
235235
}
236236

237-
auto sql = node::Utf8Value(env->isolate(), args[0].As<String>());
237+
node::Utf8Value sql(env->isolate(), args[0].As<String>());
238238
int r = sqlite3_exec(db->connection_, *sql, nullptr, nullptr, nullptr);
239239
CHECK_ERROR_OR_THROW(env->isolate(), db->connection_, r, SQLITE_OK, void());
240240
}
@@ -322,7 +322,7 @@ bool StatementSync::BindParams(const FunctionCallbackInfo<Value>& args) {
322322
return false;
323323
}
324324

325-
auto utf8_key = node::Utf8Value(env()->isolate(), key);
325+
node::Utf8Value utf8_key(env()->isolate(), key);
326326
int r = sqlite3_bind_parameter_index(statement_, *utf8_key);
327327
if (r == 0) {
328328
if (allow_bare_named_params_) {
@@ -378,7 +378,7 @@ bool StatementSync::BindValue(const Local<Value>& value, const int index) {
378378
double val = value.As<Number>()->Value();
379379
r = sqlite3_bind_double(statement_, index, val);
380380
} else if (value->IsString()) {
381-
auto val = node::Utf8Value(env()->isolate(), value.As<String>());
381+
node::Utf8Value val(env()->isolate(), value.As<String>());
382382
r = sqlite3_bind_text(
383383
statement_, index, *val, val.length(), SQLITE_TRANSIENT);
384384
} else if (value->IsNull()) {

0 commit comments

Comments
 (0)