Skip to content

Commit 5e919c3

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

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
@@ -215,7 +215,7 @@ void DatabaseSync::Prepare(const FunctionCallbackInfo<Value>& args) {
215215
return;
216216
}
217217

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

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

327-
auto utf8_key = node::Utf8Value(env()->isolate(), key);
327+
node::Utf8Value utf8_key(env()->isolate(), key);
328328
int r = sqlite3_bind_parameter_index(statement_, *utf8_key);
329329
if (r == 0) {
330330
if (allow_bare_named_params_) {
@@ -380,7 +380,7 @@ bool StatementSync::BindValue(const Local<Value>& value, const int index) {
380380
double val = value.As<Number>()->Value();
381381
r = sqlite3_bind_double(statement_, index, val);
382382
} else if (value->IsString()) {
383-
auto val = node::Utf8Value(env()->isolate(), value.As<String>());
383+
node::Utf8Value val(env()->isolate(), value.As<String>());
384384
r = sqlite3_bind_text(
385385
statement_, index, *val, val.length(), SQLITE_TRANSIENT);
386386
} else if (value->IsNull()) {

0 commit comments

Comments
 (0)