Skip to content

Commit ee798d6

Browse files
committed
src: use std::nullopt instead of {}
It expresses the intent in a clearer way. Refs: nodejs#48191 (comment) Signed-off-by: Darshan Sen <raisinten@gmail.com>
1 parent 657764b commit ee798d6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/node_sea.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,12 +292,12 @@ std::optional<std::string> GenerateCodeCache(std::string_view main_path,
292292

293293
Local<String> filename;
294294
if (!String::NewFromUtf8(isolate, main_path.data()).ToLocal(&filename)) {
295-
return {};
295+
return std::nullopt;
296296
}
297297

298298
Local<String> content;
299299
if (!String::NewFromUtf8(isolate, main_script.data()).ToLocal(&content)) {
300-
return {};
300+
return std::nullopt;
301301
}
302302

303303
std::vector<Local<String>> parameters = {
@@ -312,7 +312,7 @@ std::optional<std::string> GenerateCodeCache(std::string_view main_path,
312312
if (!contextify::CompileFunction(
313313
isolate, context, filename, content, std::move(parameters))
314314
.ToLocal(&fn)) {
315-
return {};
315+
return std::nullopt;
316316
}
317317

318318
std::unique_ptr<ScriptCompiler::CachedData> cache{

0 commit comments

Comments
 (0)