[bgen] Remove useless catch/(re)throw. (#18467)

There's no purpose to catching an exception just to throw it, so remove
the entire try/catch handler.

Fixes this compiler warning:

    src/bgen/Generator.cs(1284,4): warning CA2200: Re-throwing caught exception changes stack information
This commit is contained in:
Rolf Bjarne Kvinge 2023-06-20 18:07:28 +02:00 коммит произвёл GitHub
Родитель 7cea2a8c3a
Коммит a66950d2de
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 9 добавлений и 13 удалений

Просмотреть файл

@ -1269,22 +1269,18 @@ public partial class Generator : IMemberGatherer {
if (AttributeManager.HasAttribute<WrapAttribute> (mi))
return;
try {
// arm64 never requires stret, so we'll always need the non-stret variants
RegisterMethod (false, mi, MakeSig (mi, false), false);
RegisterMethod (false, mi, MakeSuperSig (mi, false), false);
// arm64 never requires stret, so we'll always need the non-stret variants
RegisterMethod (false, mi, MakeSig (mi, false), false);
RegisterMethod (false, mi, MakeSuperSig (mi, false), false);
if (CheckNeedStret (mi)) {
RegisterMethod (true, mi, MakeSig (mi, true), false);
RegisterMethod (true, mi, MakeSuperSig (mi, true), false);
if (CheckNeedStret (mi)) {
RegisterMethod (true, mi, MakeSig (mi, true), false);
RegisterMethod (true, mi, MakeSuperSig (mi, true), false);
if (AttributeManager.HasAttribute<AlignAttribute> (mi)) {
RegisterMethod (true, mi, MakeSig (mi, true, true), true);
RegisterMethod (true, mi, MakeSuperSig (mi, true, true), true);
}
if (AttributeManager.HasAttribute<AlignAttribute> (mi)) {
RegisterMethod (true, mi, MakeSig (mi, true, true), true);
RegisterMethod (true, mi, MakeSuperSig (mi, true, true), true);
}
} catch (BindingException ex) {
throw ex;
}
}
static char [] invalid_selector_chars = new char [] { '*', '^', '(', ')' };