Skip to content

__intern 没考虑hasecode碰撞 #11

@mshandle

Description

@mshandle

` private static string __intern(string value)
{

        int hash = value.GetHashCode();
        if (g_intern_table.ContainsKey(hash))
        {
            return g_intern_table[hash];
        }
        else
        {
            string interned = new string(NEW_ALLOC_CHAR, value.Length);
            memcpy(interned, value);
            g_intern_table.Add(hash, interned);
            return interned;
        }
    }

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions