[static registrar] Simplify code a little bit to not create an array unless needed. (#3460)

This commit is contained in:
Rolf Bjarne Kvinge 2018-02-12 14:42:55 +01:00 коммит произвёл GitHub
Родитель 0561618460
Коммит ecc5d05433
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 7 добавлений и 5 удалений

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

@ -2846,15 +2846,17 @@ namespace Registrar {
map.AppendLine ("};");
map.AppendLine ();
map.AppendLine ("static struct MTFullTokenReference __xamarin_token_references [] = {");
map.AppendLine (full_token_references);
map.AppendLine ("};");
map.AppendLine ();
if (full_token_reference_count > 0) {
map.AppendLine ("static const struct MTFullTokenReference __xamarin_token_references [] = {");
map.AppendLine (full_token_references);
map.AppendLine ("};");
map.AppendLine ();
}
map.AppendLine ("static struct MTRegistrationMap __xamarin_registration_map = {");
map.AppendLine ("__xamarin_registration_assemblies,");
map.AppendLine ("__xamarin_class_map,");
map.AppendLine ("__xamarin_token_references,");
map.AppendLine (full_token_reference_count == 0 ? "NULL," : "__xamarin_token_references,");
map.AppendLine (skipped_types.Count == 0 ? "NULL," : "__xamarin_skipped_map,");
map.AppendLine ("{0},", count);
map.AppendLine ("{0},", i);