runtime: update iterator usage
This commit is contained in:
@@ -59,7 +59,7 @@ enum bshell_status format_object_table(fx_object *object, fx_stream *dest)
|
||||
|
||||
struct bshell_table_ctx ctx;
|
||||
bshell_table_ctx_init(&ctx, dest);
|
||||
fx_iterator *it = fx_iterator_begin(object);
|
||||
const fx_iterator *it = fx_iterator_begin(object);
|
||||
if (!it) {
|
||||
bshell_table_ctx_prepare_columns_from_format(
|
||||
&ctx,
|
||||
@@ -68,17 +68,17 @@ enum bshell_status format_object_table(fx_object *object, fx_stream *dest)
|
||||
bshell_table_ctx_print_headers(&ctx);
|
||||
bshell_table_ctx_print_record(&ctx, &FX_VALUE_OBJECT(object));
|
||||
} else {
|
||||
fx_value first = fx_iterator_get_value(it);
|
||||
if (first.v_type) {
|
||||
const fx_value *first = fx_iterator_get_value(it);
|
||||
if (first) {
|
||||
bshell_table_ctx_prepare_columns_from_format(
|
||||
&ctx,
|
||||
fx_type_get_by_id(first.v_type),
|
||||
fx_type_get_by_id(first->v_type),
|
||||
fmt);
|
||||
}
|
||||
bshell_table_ctx_print_headers(&ctx);
|
||||
fx_foreach(value, it)
|
||||
{
|
||||
bshell_table_ctx_print_record(&ctx, &value);
|
||||
bshell_table_ctx_print_record(&ctx, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ enum bshell_status bshell_table_ctx_prepare_columns_from_object(
|
||||
fx_iterator *it = fx_type_get_properties(record_type);
|
||||
fx_foreach(prop_v, it)
|
||||
{
|
||||
fx_array_push_back(properties, prop_v);
|
||||
fx_array_push_back(properties, *prop_v);
|
||||
}
|
||||
fx_iterator_unref(it);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user