[pushed] Trivially simplify rust_language::print_enum
Commit Message
rust_language::print_enum computes:
int nfields = variant_type->num_fields ();
... but then does not reuse this in one spot. This patch corrects the
oversight.
---
gdb/rust-lang.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -495,7 +495,7 @@ rust_language::print_enum (struct value *val, struct ui_file *stream,
}
bool first_field = true;
- for (int j = 0; j < variant_type->num_fields (); j++)
+ for (int j = 0; j < nfields; j++)
{
if (!first_field)
gdb_puts (", ", stream);