Skip to content

Commit 1c3f43e

Browse files
committed
style(clang-tidy): fix bugprone-optional-value-conversion
Reported with sourcemeta#1754 Signed-off-by: Balakrishna Avulapati <ba@bavulapati.com>
1 parent 5fbfa7d commit 1c3f43e

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
@@ -579,15 +579,15 @@ auto SchemaFrame::analyse(const JSON &root, const SchemaWalker &walker,
579579
if (this->mode_ == SchemaFrame::Mode::Instances) {
580580
store(this->locations_, this->instances_, SchemaReferenceType::Static,
581581
SchemaFrame::LocationType::Resource, default_id_canonical,
582-
root_id.value(), root_id.value(), path,
583-
sourcemeta::core::empty_pointer, root_dialect.value(),
584-
root_base_dialect.value(), {{}}, std::nullopt);
582+
root_id, root_id.value(), path, sourcemeta::core::empty_pointer,
583+
root_dialect.value(), root_base_dialect.value(), {{}},
584+
std::nullopt);
585585
} else {
586586
store(this->locations_, this->instances_, SchemaReferenceType::Static,
587587
SchemaFrame::LocationType::Resource, default_id_canonical,
588-
root_id.value(), root_id.value(), path,
589-
sourcemeta::core::empty_pointer, root_dialect.value(),
590-
root_base_dialect.value(), {}, std::nullopt);
588+
root_id, root_id.value(), path, sourcemeta::core::empty_pointer,
589+
root_dialect.value(), root_base_dialect.value(), {},
590+
std::nullopt);
591591
}
592592

593593
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
@@ -415,7 +415,7 @@ sourcemeta::core::SchemaIterator::SchemaIterator(
415415
this->subschemas.push_back(std::move(entry));
416416
} else {
417417
const auto base_dialect{
418-
sourcemeta::core::base_dialect(schema, resolver, dialect.value())};
418+
sourcemeta::core::base_dialect(schema, resolver, dialect)};
419419
assert(base_dialect.has_value());
420420
walk(std::nullopt, pointer, instance_location, instance_location,
421421
this->subschemas, schema, walker, resolver, dialect.value(),
@@ -434,7 +434,7 @@ sourcemeta::core::SchemaIteratorFlat::SchemaIteratorFlat(
434434
sourcemeta::core::Pointer pointer;
435435
sourcemeta::core::PointerTemplate instance_location;
436436
const auto base_dialect{
437-
sourcemeta::core::base_dialect(schema, resolver, dialect.value())};
437+
sourcemeta::core::base_dialect(schema, resolver, dialect)};
438438
assert(base_dialect.has_value());
439439
walk(std::nullopt, pointer, instance_location, instance_location,
440440
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
@@ -532,7 +532,7 @@ auto URI::canonicalize() -> URI & {
532532
result_port.value() == 443};
533533

534534
if (!is_default_http_port && !is_default_https_port) {
535-
this->port_ = result_port.value();
535+
this->port_ = result_port;
536536
} else {
537537
this->port_ = std::nullopt;
538538
}

0 commit comments

Comments
 (0)