Skip to content

Commit 7945712

Browse files
authored
style(clang-tidy): fix bugprone-optional-value-conversion (#1760)
Reported with #1754 Signed-off-by: Balakrishna Avulapati <ba@bavulapati.com>
1 parent 14c16b0 commit 7945712

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/core/jsonschema/frame.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -448,15 +448,15 @@ auto SchemaFrame::analyse(const JSON &root, const SchemaWalker &walker,
448448
if (this->mode_ == SchemaFrame::Mode::Instances) {
449449
store(this->locations_, this->instances_, SchemaReferenceType::Static,
450450
SchemaFrame::LocationType::Resource, default_id_canonical,
451-
root_id.value(), root_id.value(), path,
452-
sourcemeta::core::empty_pointer, root_dialect.value(),
453-
root_base_dialect.value(), {{}}, std::nullopt);
451+
root_id, root_id.value(), path, sourcemeta::core::empty_pointer,
452+
root_dialect.value(), root_base_dialect.value(), {{}},
453+
std::nullopt);
454454
} else {
455455
store(this->locations_, this->instances_, SchemaReferenceType::Static,
456456
SchemaFrame::LocationType::Resource, default_id_canonical,
457-
root_id.value(), root_id.value(), path,
458-
sourcemeta::core::empty_pointer, root_dialect.value(),
459-
root_base_dialect.value(), {}, std::nullopt);
457+
root_id, root_id.value(), path, sourcemeta::core::empty_pointer,
458+
root_dialect.value(), root_base_dialect.value(), {},
459+
std::nullopt);
460460
}
461461

462462
base_uris.insert({path, {default_id_canonical}});

src/core/jsonschema/walker.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ sourcemeta::core::SchemaIterator::SchemaIterator(
410410
this->subschemas.push_back(std::move(entry));
411411
} else {
412412
const auto base_dialect{
413-
sourcemeta::core::base_dialect(schema, resolver, dialect.value())};
413+
sourcemeta::core::base_dialect(schema, resolver, dialect)};
414414
assert(base_dialect.has_value());
415415
walk(std::nullopt, pointer, instance_location, instance_location,
416416
this->subschemas, schema, walker, resolver, dialect.value(),
@@ -429,7 +429,7 @@ sourcemeta::core::SchemaIteratorFlat::SchemaIteratorFlat(
429429
sourcemeta::core::Pointer pointer;
430430
sourcemeta::core::PointerTemplate instance_location;
431431
const auto base_dialect{
432-
sourcemeta::core::base_dialect(schema, resolver, dialect.value())};
432+
sourcemeta::core::base_dialect(schema, resolver, dialect)};
433433
assert(base_dialect.has_value());
434434
walk(std::nullopt, pointer, instance_location, instance_location,
435435
this->subschemas, schema, walker, resolver, dialect.value(),

src/core/uri/uri.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ auto URI::canonicalize() -> URI & {
546546
result_port.value() == 443};
547547

548548
if (!is_default_http_port && !is_default_https_port) {
549-
this->port_ = result_port.value();
549+
this->port_ = result_port;
550550
} else {
551551
this->port_ = std::nullopt;
552552
}

0 commit comments

Comments
 (0)