diff --git a/src/util/name_set.cpp b/src/util/name_set.cpp index 0ea3568ee..820d8f6e4 100644 --- a/src/util/name_set.cpp +++ b/src/util/name_set.cpp @@ -18,6 +18,13 @@ name mk_unique(name_set const & s, name const & suggestion) { } } +name_set to_name_set(buffer const & ns) { + name_set r; + for (name const & n : ns) + r.insert(n); + return r; +} + DECL_UDATA(name_set) static int mk_name_set(lua_State * L) { name_set r; diff --git a/src/util/name_set.h b/src/util/name_set.h index d1cfcc0af..e032f904a 100644 --- a/src/util/name_set.h +++ b/src/util/name_set.h @@ -13,6 +13,8 @@ typedef rb_tree name_set; /** \brief Make a name that does not occur in \c s, based on the given suggestion. */ name mk_unique(name_set const & s, name const & suggestion); +name_set to_name_set(buffer const & ns); + UDATA_DEFS_CORE(name_set) void open_name_set(lua_State * L); }