git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6133
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
{
// Should NEVER be
long k = (long) key;
{
// Should NEVER be
long k = (long) key;
int position = (int) (k % n);
int position = (int) (k % n);
+ if (position < 0) position = -position;
+
if (!hash_table[position])
{
hash_table[position] = new wxList (wxKEY_INTEGER);
if (!hash_table[position])
{
hash_table[position] = new wxList (wxKEY_INTEGER);
void wxHashTable::Put (long key, const wxChar *value, wxObject * object)
{
// Should NEVER be
void wxHashTable::Put (long key, const wxChar *value, wxObject * object)
{
// Should NEVER be
- long k = (long) key;
- if (k < 0)
- k = -k;
int position = (int) (k % n);
int position = (int) (k % n);
+ if (position < 0) position = -position;
+
if (!hash_table[position])
{
hash_table[position] = new wxList (wxKEY_INTEGER);
if (!hash_table[position])
{
hash_table[position] = new wxList (wxKEY_INTEGER);
{
// Should NEVER be
long k = (long) key;
{
// Should NEVER be
long k = (long) key;
int position = (int) (k % n);
int position = (int) (k % n);
+ if (position < 0) position = -position;
+
if (!hash_table[position])
{
hash_table[position] = new wxList (wxKEY_INTEGER);
if (!hash_table[position])
{
hash_table[position] = new wxList (wxKEY_INTEGER);
void wxHashTable::Put (const wxChar *key, wxObject * object)
{
int position = (int) (MakeKey (key) % n);
void wxHashTable::Put (const wxChar *key, wxObject * object)
{
int position = (int) (MakeKey (key) % n);
+ if (position < 0) position = -position;
if (!hash_table[position])
{
if (!hash_table[position])
{
{
// Should NEVER be
long k = (long) key;
{
// Should NEVER be
long k = (long) key;
int position = (int) (k % n);
int position = (int) (k % n);
+ if (position < 0) position = -position;
+
if (!hash_table[position])
return (wxObject *) NULL;
else
if (!hash_table[position])
return (wxObject *) NULL;
else
{
// Should NEVER be
long k = (long) key;
{
// Should NEVER be
long k = (long) key;
int position = (int) (k % n);
int position = (int) (k % n);
+ if (position < 0) position = -position;
+
if (!hash_table[position])
return (wxObject *) NULL;
else
if (!hash_table[position])
return (wxObject *) NULL;
else
{
// Should NEVER be
long k = (long) key;
{
// Should NEVER be
long k = (long) key;
int position = (int) (k % n);
int position = (int) (k % n);
+ if (position < 0) position = -position;
+
if (!hash_table[position])
return (wxObject *) NULL;
else
if (!hash_table[position])
return (wxObject *) NULL;
else
wxObject *wxHashTable::Get (const wxChar *key) const
{
int position = (int) (MakeKey (key) % n);
wxObject *wxHashTable::Get (const wxChar *key) const
{
int position = (int) (MakeKey (key) % n);
+ if (position < 0) position = -position;
if (!hash_table[position])
return (wxObject *) NULL;
if (!hash_table[position])
return (wxObject *) NULL;
{
// Should NEVER be
long k = (long) key;
{
// Should NEVER be
long k = (long) key;
int position = (int) (k % n);
int position = (int) (k % n);
+ if (position < 0) position = -position;
+
if (!hash_table[position])
return (wxObject *) NULL;
else
if (!hash_table[position])
return (wxObject *) NULL;
else
wxObject *wxHashTable::Delete (const wxChar *key)
{
int position = (int) (MakeKey (key) % n);
wxObject *wxHashTable::Delete (const wxChar *key)
{
int position = (int) (MakeKey (key) % n);
+ if (position < 0) position = -position;
+
if (!hash_table[position])
return (wxObject *) NULL;
else
if (!hash_table[position])
return (wxObject *) NULL;
else
wxObject *wxHashTable::Delete (long key, int value)
{
// Should NEVER be
wxObject *wxHashTable::Delete (long key, int value)
{
// Should NEVER be
- long k = (long) key;
- if (k < 0)
- k = -k;
int position = (int) (k % n);
int position = (int) (k % n);
+ if (position < 0) position = -position;
+
if (!hash_table[position])
return (wxObject *) NULL;
else
if (!hash_table[position])
return (wxObject *) NULL;
else
wxObject *wxHashTable::Delete (long key, const wxChar *value)
{
int position = (int) (key % n);
wxObject *wxHashTable::Delete (long key, const wxChar *value)
{
int position = (int) (key % n);
+ if (position < 0) position = -position;
+
if (!hash_table[position])
return (wxObject *) NULL;
else
if (!hash_table[position])
return (wxObject *) NULL;
else