mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 22:15:23 +00:00
[1792] unrelated cleanup: constify and fold a long line
just noticed them and the changes are small, so I did it here.
This commit is contained in:
@@ -82,13 +82,15 @@ createInstance(isc::data::ConstElementPtr config, std::string& error) {
|
|||||||
error = "Configuration error: " + errors->str();
|
error = "Configuration error: " + errors->str();
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
std::string dbfile = config->get(CONFIG_ITEM_DATABASE_FILE)->stringValue();
|
const std::string dbfile =
|
||||||
|
config->get(CONFIG_ITEM_DATABASE_FILE)->stringValue();
|
||||||
try {
|
try {
|
||||||
boost::shared_ptr<DatabaseAccessor> sqlite3_accessor(
|
boost::shared_ptr<DatabaseAccessor> sqlite3_accessor(
|
||||||
new SQLite3Accessor(dbfile, "IN")); // XXX: avoid hardcode RR class
|
new SQLite3Accessor(dbfile, "IN")); // XXX: avoid hardcode RR class
|
||||||
return (new DatabaseClient(isc::dns::RRClass::IN(), sqlite3_accessor));
|
return (new DatabaseClient(isc::dns::RRClass::IN(), sqlite3_accessor));
|
||||||
} catch (const std::exception& exc) {
|
} catch (const std::exception& exc) {
|
||||||
error = std::string("Error creating sqlite3 datasource: ") + exc.what();
|
error = std::string("Error creating sqlite3 datasource: ") +
|
||||||
|
exc.what();
|
||||||
return (NULL);
|
return (NULL);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
error = std::string("Error creating sqlite3 datasource, "
|
error = std::string("Error creating sqlite3 datasource, "
|
||||||
|
Reference in New Issue
Block a user