mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-19 01:07:00 -04:00
refactor(categorizer): replace exception with assertion
This commit is contained in:
parent
181098e0c0
commit
1d426f3331
@ -369,10 +369,8 @@ void categorizer_registry::register_factory(
|
|||||||
std::unique_ptr<categorizer_factory const>&& factory) {
|
std::unique_ptr<categorizer_factory const>&& factory) {
|
||||||
auto name = factory->name();
|
auto name = factory->name();
|
||||||
|
|
||||||
if (!factories_.emplace(name, std::move(factory)).second) {
|
DWARFS_CHECK(factories_.emplace(name, std::move(factory)).second,
|
||||||
std::cerr << "categorizer factory name conflict (" << name << "\n";
|
fmt::format("categorizer factory name conflict: {}", name));
|
||||||
std::abort();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<categorizer> categorizer_registry::create(
|
std::unique_ptr<categorizer> categorizer_registry::create(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user