From f8bf9679124799ee80e03a0d18113f2a721e7390 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Sun, 28 Oct 2018 21:15:07 -0400 Subject: [PATCH] rewrites/re-enables +xeb jet --- jets/c/xeb.c | 18 ++++-------------- jets/tree.c | 8 +++----- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/jets/c/xeb.c b/jets/c/xeb.c index 04e6bab2d..f0a191fcb 100644 --- a/jets/c/xeb.c +++ b/jets/c/xeb.c @@ -9,22 +9,12 @@ u3_noun u3qc_xeb(u3_atom a) { - mpz_t a_mp; + c3_w met_w = u3r_met(0, a); - if ( __(u3a_is_dog(a)) ) { - u3r_mp(a_mp, a); - c3_d x = mpz_sizeinbase(a_mp, 2); - mpz_t b_mp; - mpz_init_set_ui(b_mp, x); - return u3i_mp(b_mp); - } - else { - mpz_init_set_ui(a_mp, a); - c3_d x = mpz_sizeinbase(a_mp, 2); - mpz_t b_mp; - mpz_init_set_ui(b_mp, x); - return u3i_mp(b_mp); + if ( !_(u3a_is_cat(met_w)) ) { + return u3i_words(1, &met_w); } + else return met_w; } u3_noun u3wc_xeb(u3_noun cor) diff --git a/jets/tree.c b/jets/tree.c index 9804473fb..8a749fb95 100644 --- a/jets/tree.c +++ b/jets/tree.c @@ -788,9 +788,8 @@ static u3j_harm _141_two_sqt_a[] = {{".2", u3wc_sqt, c3y}, {}}; static c3_c* _141_two_sqt_ha[] = {0}; static u3j_harm _141_two_vor_a[] = {{".2", u3wc_vor, c3y}, {}}; static c3_c* _141_two_vor_ha[] = {0}; -// disabled, leaks -// static u3j_harm _141_two_xeb_a[] = {{".2", u3wc_xeb, c3y}, {}}; -// static c3_c* _141_two_xeb_ha[] = {0}; +static u3j_harm _141_two_xeb_a[] = {{".2", u3wc_xeb, c3y}, {}}; +static c3_c* _141_two_xeb_ha[] = {0}; static u3j_harm _141_two__in_bif_a[] = {{".2", u3wdi_bif}, {}}; static c3_c* _141_two__in_bif_ha[] = {0}; @@ -929,8 +928,7 @@ static u3j_core _141_two_d[] = { "pow", 7, _141_two_pow_a, 0, _141_two_pow_ha }, { "sqt", 7, _141_two_sqt_a, 0, _141_two_sqt_ha }, { "vor", 7, _141_two_vor_a, 0, _141_two_vor_ha }, - // disabled, leaks - // { "xeb", 7, _141_two_xeb_a, 0, _141_two_xeb_ha }, + { "xeb", 7, _141_two_xeb_a, 0, _141_two_xeb_ha }, { "by", 7, 0, _141_two__by_d, _141_two__by_ha }, { "in", 7, 0, _141_two__in_d, _141_two__in_ha },