Ignore:
Timestamp:
Nov 16, 2011, 12:05:40 AM (14 years ago)
Author:
Darin Adler
Message:

Fix some hash traits that don't derive from the base hash traits
https://bugs.webkit.org/show_bug.cgi?id=72470

Reviewed by Filip Pizlo.

Hash traits structures need to derive from the base hash traits in
HashTraits.h, but some were not. This is needed for compatibility with
some additional traits we will be adding to make OwnPtr work with HashMap.

  • runtime/Identifier.h: Make IdentifierMapIndexHashTraits derive from

HashTraits<int>. This enabled removal of all the members except for the
ones that control the empty value, because this is otherwise the same
as the standard int hash.

  • runtime/SymbolTable.h: Changed SymbolTableIndexHashTraits to derive

from HashTraits<SymbolTableEntry> and removed redundant members.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/SymbolTable.h

    r76248 r100417  
    3333#include "UString.h"
    3434#include <wtf/AlwaysInline.h>
     35#include <wtf/HashTraits.h>
    3536
    3637namespace JSC {
     
    113114    };
    114115
    115     struct SymbolTableIndexHashTraits {
    116         typedef SymbolTableEntry TraitType;
    117         static SymbolTableEntry emptyValue() { return SymbolTableEntry(); }
     116    struct SymbolTableIndexHashTraits : HashTraits<SymbolTableEntry> {
    118117        static const bool emptyValueIsZero = true;
    119118        static const bool needsDestruction = false;
Note: See TracChangeset for help on using the changeset viewer.