Skip to content

Commit

Permalink
it doesn't make sense to return empty partition, 'out_of_range' excep…
Browse files Browse the repository at this point in the history
…tion is better
  • Loading branch information
AndreyG committed Oct 5, 2023
1 parent ecf9816 commit 1906ccf
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/core/src/File.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,16 +248,12 @@ namespace ifc
auto partition = *cached_partition;
return { static_cast<T const*>(partition.data), partition.size };
}
else if (auto it = table_of_contents_.find(name); it != table_of_contents_.end())
else
{
auto result = get_partition<T, Index>(it->second);
auto result = get_partition<T, Index>(table_of_contents_.at(name));
cached_partition.emplace(result.data(), result.size());
return result;
}
else
{
return Partition<T, Index>{nullptr, 0};
}
}

std::unordered_map<DeclIndex, std::vector<AttrIndex>> const & trait_declaration_attributes()
Expand Down

0 comments on commit 1906ccf

Please sign in to comment.