diff --git a/c/containers/mixutil.c b/c/containers/mixutil.c index 14e717bf2..230b41efc 100644 --- a/c/containers/mixutil.c +++ b/c/containers/mixutil.c @@ -92,3 +92,22 @@ int lrec_slls_compare_lexically( { return -slls_lrec_compare_lexically(plist, prec, pkeys); } + +// ---------------------------------------------------------------- +int lrec_keys_equal_list( + lrec_t* prec, + slls_t* plist) +{ + lrece_t* pe = prec->phead; + sllse_t* pf = plist->phead; + while (TRUE) { + if (pe == NULL && pf == NULL) + return TRUE; + if (pe == NULL || pf == NULL) + return FALSE; + if (!streq(pe->value, pf->value)) + return FALSE; + pe = pe->pnext; + pf = pf->pnext; + } +} diff --git a/c/containers/mixutil.h b/c/containers/mixutil.h index c3d78becb..2f5f21c5e 100644 --- a/c/containers/mixutil.h +++ b/c/containers/mixutil.h @@ -25,4 +25,9 @@ int lrec_slls_compare_lexically( slls_t* pkeys, slls_t* plist); +// xxx cmt for output writers +int lrec_keys_equal_list( + lrec_t* prec, + slls_t* plist); + #endif // MIXUTIL_H diff --git a/c/todo.txt b/c/todo.txt index 2bab14f47..5b8d168d8 100644 --- a/c/todo.txt +++ b/c/todo.txt @@ -9,18 +9,6 @@ TOP OF LIST ---------------------------------------------------------------- !! get rid of some unnecessary calls to slls_copy: - ./containers/join_bucket_keeper.c: - slls_t* pnext_field_values = mlr_selected_values_from_record(pkeeper->prec_peek, - pkeeper->pleft_field_names); - int cmp = slls_compare_lexically(pkeeper->pbucket->pleft_field_values, pnext_field_values); - - int slls_lrec_compare_lexically( - slls_t* plist, - lrec_t* prec, - slls_t* pkeys) - { - } - ./output/lrec_writer_pprint.c: // xxx make a fcn which does the cmp of lrec & slls w/o the copy pcurr_keys = mlr_keys_from_record(prec); @@ -45,8 +33,7 @@ TOP OF LIST of one format?? !! join - -> cmp w/o slls method; & propagate throughout miller - -> xxx cleanup + -> cleanup of xxx cmts -> left/right-prefix UTs -> het UTs -> mixed-format/separator UT cases