Ignore:
Timestamp:
Jan 4, 2010, 2:00:38 PM (15 years ago)
Author:
[email protected]
Message:

JavaScriptCore: https://bugs.webkit.org/show_bug.cgi?id=33163
Add string hashing functions to WTF.
Use WTF's string hashing functions from UStringImpl.

Reviewed by Sam Weinig.

(JSC::UStringImpl::computeHash):

  • wtf/HashFunctions.h:

(WTF::stringHash):

WebCore: https://bugs.webkit.org/show_bug.cgi?id=33163
Use WTF's string hashing functions from StringImpl.

Reviewed by Sam Weinig.

  • platform/text/StringImpl.h:

(WebCore::StringImpl::computeHash):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/UStringImpl.h

    r52500 r52758  
    2828
    2929#include <wtf/CrossThreadRefCounted.h>
     30#include <wtf/HashFunctions.h>
    3031#include <wtf/OwnFastMallocPtr.h>
    3132#include <wtf/PossiblyNull.h>
     
    160161    }
    161162
    162     static unsigned computeHash(const UChar*, int length);
    163     static unsigned computeHash(const char*, int length);
    164     static unsigned computeHash(const char* s) { return computeHash(s, strlen(s)); }
     163    static unsigned computeHash(const UChar* s, int length) { ASSERT(length >= 0); return WTF::stringHash(s, length); }
     164    static unsigned computeHash(const char* s, int length) { ASSERT(length >= 0); return WTF::stringHash(s, length); }
     165    static unsigned computeHash(const char* s) { return WTF::stringHash(s); }
    165166
    166167    static UStringImpl& null() { return *s_null; }
Note: See TracChangeset for help on using the changeset viewer.