X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fscm-hash.cc;h=0b1e0b4e2532a7cc481ba4a794270aa3caa44799;hb=97a0169312a260933246ab224e4f8b0969871dd5;hp=3eb40ada7bfe929576fc50cb1c081d368951b488;hpb=0398fdb9df24ac2e22a8cbff1b3c18ca04e9f221;p=lilypond.git diff --git a/lily/scm-hash.cc b/lily/scm-hash.cc index 3eb40ada7b..0b1e0b4e25 100644 --- a/lily/scm-hash.cc +++ b/lily/scm-hash.cc @@ -21,8 +21,6 @@ #include -const char * const Scheme_hash_table::type_p_name_ = 0; - SCM Scheme_hash_table::make_smob () { @@ -69,9 +67,13 @@ Scheme_hash_table::set (SCM k, SCM v) SCM Scheme_hash_table::get (SCM k) const { - /* SCM_UNSPECIFIED will stick out like a sore thumb, hopefully. + /* SCM_UNDEFINED is the default for unset elements, but + scm_hashq_ref cannot return it, so we do it a bit more awkwardly. */ - return scm_hashq_ref (hash_tab (), k, SCM_UNSPECIFIED); + SCM handle = scm_hashq_get_handle (hash_tab (), k); + if (scm_is_pair (handle)) + return scm_cdr (handle); + return SCM_UNDEFINED; } void