@@ -39,8 +39,7 @@ std::string ToString(const MetadataLogEntry& entry) {
3939 entry.metadata_file );
4040}
4141
42- Result<std::reference_wrapper<const std::shared_ptr<Schema>>> TableMetadata::Schema ()
43- const {
42+ Result<std::shared_ptr<Schema>> TableMetadata::Schema () const {
4443 auto iter = std::ranges::find_if (schemas, [this ](const auto & schema) {
4544 return schema->schema_id () == current_schema_id;
4645 });
@@ -50,11 +49,10 @@ Result<std::reference_wrapper<const std::shared_ptr<Schema>>> TableMetadata::Sch
5049 .message = std::format (" Current schema is not found" ),
5150 });
5251 }
53- return std::cref ( *iter) ;
52+ return *iter;
5453}
5554
56- Result<std::reference_wrapper<const std::shared_ptr<PartitionSpec>>>
57- TableMetadata::PartitionSpec () const {
55+ Result<std::shared_ptr<PartitionSpec>> TableMetadata::PartitionSpec () const {
5856 auto iter = std::ranges::find_if (partition_specs, [this ](const auto & spec) {
5957 return spec->spec_id () == default_spec_id;
6058 });
@@ -64,11 +62,10 @@ TableMetadata::PartitionSpec() const {
6462 .message = std::format (" Default partition spec is not found" ),
6563 });
6664 }
67- return std::cref ( *iter) ;
65+ return *iter;
6866}
6967
70- Result<std::reference_wrapper<const std::shared_ptr<SortOrder>>>
71- TableMetadata::SortOrder () const {
68+ Result<std::shared_ptr<SortOrder>> TableMetadata::SortOrder () const {
7269 auto iter = std::ranges::find_if (sort_orders, [this ](const auto & order) {
7370 return order->order_id () == default_sort_order_id;
7471 });
@@ -78,7 +75,7 @@ TableMetadata::SortOrder() const {
7875 .message = std::format (" Default sort order is not found" ),
7976 });
8077 }
81- return std::cref ( *iter) ;
78+ return *iter;
8279}
8380
8481Result<TimePointMs> TimePointMsFromUnixMs (int64_t unix_ms) {
0 commit comments