From fe0169559421cb91706a2a52ebbe61384fec0b76 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Fri, 18 Sep 2020 11:22:36 -0700 Subject: [PATCH] u3: use u3s_cue_sill_with() in u3u_uncram() --- pkg/urbit/noun/urth.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/pkg/urbit/noun/urth.c b/pkg/urbit/noun/urth.c index 876e2d5dc1..04b84bc445 100644 --- a/pkg/urbit/noun/urth.c +++ b/pkg/urbit/noun/urth.c @@ -860,23 +860,20 @@ u3u_uncram(c3_c* dir_c, c3_d eve_d) // XX errors are fatal, barring a full "u3m_reboot"-type operation. // { - ur_dict32_t dic_u = {0}; - u3_noun roc, cod, ref; - // XX tune the initial dictionary size for less reallocation // - ur_dict32_grow((ur_root_t*)0, &dic_u, ur_fib33, ur_fib34); + u3_cue_sill* sil_u = u3s_cue_sill_init_with(ur_fib33, ur_fib34); + u3_weak ref = u3s_cue_sill_with(sil_u, len_d, byt_y); + u3_noun roc, cod; - if ( c3n == u3s_cue_xeno_unsafe(&dic_u, len_d, byt_y, &ref) ) { + u3s_cue_sill_done(sil_u); + + if ( u3_none == ref ) { fprintf(stderr, "uncram: failed to cue rock\r\n"); - ur_dict_free((ur_dict_t*)&dic_u); c3_free(nam_c); return c3n; } - - ur_dict_free((ur_dict_t*)&dic_u); - - if ( c3n == u3r_pq(ref, c3__fast, &roc, &cod) ) { + else if ( c3n == u3r_pq(ref, c3__fast, &roc, &cod) ) { fprintf(stderr, "uncram: failed: invalid rock format\r\n"); u3z(ref); c3_free(nam_c);