~ubuntu-branches/ubuntu/lucid/webkit/lucid-security

« back to all changes in this revision

Viewing changes to JavaScriptCore/wtf/StringHashFunctions.h

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2010-01-20 20:09:57 UTC
  • mfrom: (1.2.7 upstream) (4.3.8 sid)
  • Revision ID: james.westby@ubuntu.com-20100120200957-3ng8lah18c7pmm52
* New upstream release
- Fixes crashes related to clearing the clipboard, which many users were
  experiencing (Closes: #565166)

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
    hash += hash >> 15;
61
61
    hash ^= hash << 10;
62
62
 
 
63
    hash &= 0x7fffffff;
 
64
 
63
65
    // this avoids ever returning a hash code of 0, since that is used to
64
66
    // signal "hash not computed yet", using a value that is likely to be
65
67
    // effectively the same as 0 when the low bits are masked
66
68
    if (hash == 0)
67
 
        hash = 0x80000000;
 
69
        hash = 0x40000000;
68
70
 
69
71
    return hash;
70
72
}
98
100
    hash += hash >> 15;
99
101
    hash ^= hash << 10;
100
102
 
 
103
    hash &= 0x7fffffff;
 
104
 
101
105
    // this avoids ever returning a hash code of 0, since that is used to
102
106
    // signal "hash not computed yet", using a value that is likely to be
103
107
    // effectively the same as 0 when the low bits are masked
104
108
    if (hash == 0)
105
 
        hash = 0x80000000;
 
109
        hash = 0x40000000;
106
110
 
107
111
    return hash;
108
112
}
137
141
    hash += hash >> 15;
138
142
    hash ^= hash << 10;
139
143
 
 
144
    hash &= 0x7fffffff;
 
145
 
140
146
    // This avoids ever returning a hash code of 0, since that is used to
141
147
    // signal "hash not computed yet", using a value that is likely to be
142
148
    // effectively the same as 0 when the low bits are masked.
143
149
    if (hash == 0)
144
 
        hash = 0x80000000;
 
150
        hash = 0x40000000;
145
151
 
146
152
    return hash;
147
153
}