Skip to content

Commit

Permalink
remove useless try/catch
Browse files Browse the repository at this point in the history
  • Loading branch information
barnhill committed Jan 29, 2021
1 parent b1c7180 commit 3a0fa89
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions BarcodeStandard/Symbologies/EAN13.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,30 +76,27 @@ private string Encode_EAN13()
var twodigitCode = Raw_Data.Substring(0, 2);
var threedigitCode = Raw_Data.Substring(0, 3);

try
var cc = _countryCodes[threedigitCode];
if (cc == null)
{
var cc = _countryCodes[threedigitCode];
cc = _countryCodes[twodigitCode].ToString();
if (cc == null)
{
cc = _countryCodes[twodigitCode].ToString();
if (cc == null)
{
Error("EEAN13-3: Country assigning manufacturer code not found.");
}
else
{
_countryAssigningManufacturerCode = cc.ToString();
}
Error("EEAN13-3: Country assigning manufacturer code not found.");
}
else
{
_countryAssigningManufacturerCode = cc.ToString();
}

}
finally { _countryCodes.Clear(); }
}
else
{
_countryAssigningManufacturerCode = cc.ToString();
}

_countryCodes.Clear();

return result;
return result;
}//Encode_EAN13

private void Create_CountryCodeRange(int startingNumber, int endingNumber, string countryDescription)
Expand Down

0 comments on commit 3a0fa89

Please sign in to comment.