Skip to content

Commit

Permalink
Namecoin / Qt: Merge adjacent try/catch clauses
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Rand committed Jan 5, 2023
1 parent 1200093 commit 84192ec
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions src/qt/nametablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,13 @@ class NameTablePriv

const std::string hexName = maybeName.get_str();
std::string name;
try
{
name = NameTableModel::hexToAscii(QString::fromStdString(hexName)).toStdString();
}
catch (const InvalidNameString& exc)
{
continue;
}

const std::string hexData = maybeData.get_str();
std::string data;

try
{
name = NameTableModel::hexToAscii(QString::fromStdString(hexName)).toStdString();
data = NameTableModel::hexToAscii(QString::fromStdString(hexData)).toStdString();
}
catch (const InvalidNameString& exc)
Expand Down Expand Up @@ -180,19 +174,13 @@ class NameTablePriv

const std::string hexName = maybeName.get_str();
std::string name;
try
{
name = NameTableModel::hexToAscii(QString::fromStdString(hexName)).toStdString();
}
catch (const InvalidNameString& exc)
{
continue;
}

const std::string hexData = maybeData.get_str();
std::string data;

try
{
name = NameTableModel::hexToAscii(QString::fromStdString(hexName)).toStdString();
data = NameTableModel::hexToAscii(QString::fromStdString(hexData)).toStdString();
}
catch (const InvalidNameString& exc)
Expand Down

0 comments on commit 84192ec

Please sign in to comment.