View | Details | Raw Unified | Return to bug 181603 | Differences between
and this patch

Collapse All | Expand All

(-)src/hash/dbo_hash.h (-4 / +4 lines)
Lines 106-112 public: Link Here
106
    inline bool remove(KT key)
106
    inline bool remove(KT key)
107
    {
107
    {
108
        struct dbo_hash_slot<KT, VT> *slot;
108
        struct dbo_hash_slot<KT, VT> *slot;
109
        if (! search(key, &slot))
109
        if (! this->search(key, &slot))
110
            return false;
110
            return false;
111
        slot->key = deletedKey;
111
        slot->key = deletedKey;
112
        slot->value->release();
112
        slot->value->release();
Lines 136-142 public: Link Here
136
    inline void put(KT key, zmm::Ref<VT> value)
136
    inline void put(KT key, zmm::Ref<VT> value)
137
    {
137
    {
138
        struct dbo_hash_slot<KT, VT> *slot;
138
        struct dbo_hash_slot<KT, VT> *slot;
139
        search(key, &slot);
139
        this->search(key, &slot);
140
        put(key, (hash_slot_t)slot, value);
140
        put(key, (hash_slot_t)slot, value);
141
    }
141
    }
142
    void put(KT key, hash_slot_t destSlot, zmm::Ref<VT> value)
142
    void put(KT key, hash_slot_t destSlot, zmm::Ref<VT> value)
Lines 162-168 public: Link Here
162
    inline zmm::Ref<VT> get(KT key)
162
    inline zmm::Ref<VT> get(KT key)
163
    {
163
    {
164
        struct dbo_hash_slot<KT, VT> *slot;
164
        struct dbo_hash_slot<KT, VT> *slot;
165
        bool found = search(key, &slot);
165
        bool found = this->search(key, &slot);
166
        if (found)
166
        if (found)
167
            return zmm::Ref<VT>(slot->value);
167
            return zmm::Ref<VT>(slot->value);
168
        else
168
        else
Lines 174-180 public: Link Here
174
    inline zmm::Ref<VT> get(KT key, hash_slot_t *destSlot)
174
    inline zmm::Ref<VT> get(KT key, hash_slot_t *destSlot)
175
    {
175
    {
176
        struct dbo_hash_slot<KT, VT> **slot = (struct dbo_hash_slot<KT, VT> **)destSlot;
176
        struct dbo_hash_slot<KT, VT> **slot = (struct dbo_hash_slot<KT, VT> **)destSlot;
177
        bool found = search(key, slot);
177
        bool found = this->search(key, slot);
178
        if (found)
178
        if (found)
179
            return zmm::Ref<VT>((*slot)->value);
179
            return zmm::Ref<VT>((*slot)->value);
180
        else
180
        else
(-)src/hash/dbr_hash.h.patched (-4 / +4 lines)
Lines 124-130 public: Link Here
124
    inline bool remove(KT key)
124
    inline bool remove(KT key)
125
    {
125
    {
126
        struct dbr_hash_slot<KT> *slot;
126
        struct dbr_hash_slot<KT> *slot;
127
        if (! search(key, &slot))
127
        if (! this->search(key, &slot))
128
            return false;
128
            return false;
129
        slot->key = deletedKey;
129
        slot->key = deletedKey;
130
        int array_slot = slot->array_slot;
130
        int array_slot = slot->array_slot;
Lines 134-140 public: Link Here
134
            return true;
134
            return true;
135
        }
135
        }
136
        data_array[array_slot] = data_array[--this->count];
136
        data_array[array_slot] = data_array[--this->count];
137
        if (! search(data_array[array_slot], &slot))
137
        if (! this->search(data_array[array_slot], &slot))
138
        {
138
        {
139
            log_debug("DBR-Hash-Error: (%d; array_slot=%d; count=%d)\n", data_array[array_slot], array_slot, this->count);
139
            log_debug("DBR-Hash-Error: (%d; array_slot=%d; count=%d)\n", data_array[array_slot], array_slot, this->count);
140
            throw zmm::Exception(_("DBR-Hash-Error: key in data_array not found in hashtable"));
140
            throw zmm::Exception(_("DBR-Hash-Error: key in data_array not found in hashtable"));
Lines 146-152 public: Link Here
146
    inline void put(KT key)
146
    inline void put(KT key)
147
    {
147
    {
148
        struct dbr_hash_slot<KT> *slot;
148
        struct dbr_hash_slot<KT> *slot;
149
        if (! search(key, &slot))
149
        if (! this->search(key, &slot))
150
        {
150
        {
151
#ifdef TOMBDEBUG
151
#ifdef TOMBDEBUG
152
            if (this->count >= realCapacity)
152
            if (this->count >= realCapacity)
Lines 194-200 public: Link Here
194
    inline bool exists(KT key)
194
    inline bool exists(KT key)
195
    {
195
    {
196
        struct dbr_hash_slot<KT> *slot;
196
        struct dbr_hash_slot<KT> *slot;
197
        return search(key, &slot);
197
        return this->search(key, &slot);
198
    }
198
    }
199
    
199
    
200
    /*
200
    /*
(-)src/hash/dso_hash.h.patched (-4 / +4 lines)
Lines 100-106 public: Link Here
100
    inline bool remove(zmm::String key)
100
    inline bool remove(zmm::String key)
101
    {
101
    {
102
        struct dso_hash_slot<VT> *slot;
102
        struct dso_hash_slot<VT> *slot;
103
        if (! search(key, &slot))
103
        if (! this->search(key, &slot))
104
            return false;
104
            return false;
105
        slot->key->release();
105
        slot->key->release();
106
        slot->value->release();
106
        slot->value->release();
Lines 112-118 public: Link Here
112
    inline void put(zmm::String key, zmm::Ref<VT> value)
112
    inline void put(zmm::String key, zmm::Ref<VT> value)
113
    {
113
    {
114
        struct dso_hash_slot<VT> *slot;
114
        struct dso_hash_slot<VT> *slot;
115
        search(key, &slot);
115
        this->search(key, &slot);
116
        put(key, (hash_slot_t)slot, value);
116
        put(key, (hash_slot_t)slot, value);
117
    }
117
    }
118
    void put(zmm::String key, hash_slot_t destSlot, zmm::Ref<VT> value)
118
    void put(zmm::String key, hash_slot_t destSlot, zmm::Ref<VT> value)
Lines 141-147 public: Link Here
141
    inline zmm::Ref<VT> get(zmm::String key)
141
    inline zmm::Ref<VT> get(zmm::String key)
142
    {
142
    {
143
        struct dso_hash_slot<VT> *slot;
143
        struct dso_hash_slot<VT> *slot;
144
        bool found = search(key, &slot);
144
        bool found = this->search(key, &slot);
145
        if (found)
145
        if (found)
146
            return zmm::Ref<VT>(slot->value);
146
            return zmm::Ref<VT>(slot->value);
147
        else
147
        else
Lines 153-159 public: Link Here
153
    inline zmm::Ref<VT> get(zmm::String key, hash_slot_t *destSlot)
153
    inline zmm::Ref<VT> get(zmm::String key, hash_slot_t *destSlot)
154
    {
154
    {
155
        struct dso_hash_slot<VT> **slot = (struct dso_hash_slot<VT> **)destSlot;
155
        struct dso_hash_slot<VT> **slot = (struct dso_hash_slot<VT> **)destSlot;
156
        bool found = search(key, slot);
156
        bool found = this->search(key, slot);
157
        if (found)
157
        if (found)
158
            return zmm::Ref<VT>((*slot)->value);
158
            return zmm::Ref<VT>((*slot)->value);
159
        else
159
        else

Return to bug 181603