https://issues.dlang.org/show_bug.cgi?id=17234

Simen Kjaeraas <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |[email protected]
         Resolution|WORKSFORME                  |---

--- Comment #4 from Simen Kjaeraas <[email protected]> ---
locate goes the opposite way: Given a name, get the tid. What's being requested
here is given a tid, get the name(s).

Something like this:

/**
 * Gets the names associated with tid.
 *
 * Params:
 *  tid = The Tid to locate within the registry.
 *
 * Returns:
 *  The associated names or null if tid is not registered.
 */
string[] locate(Tid tid) {
    synchronized (registryLock)
    {
        if (auto name = tid in namesByTid)
            return *name;
        return [];
    }
}

--

Reply via email to