Esempio n. 1
0
        //void* GetVoidPtr(uint key) const; // default_val is NULL
        //void SetVoidPtr(uint key, void* val);

        // FIXME-OPT: Need a way to reuse the result of lower_bound when doing GetInt()/SetInt() - not too bad because it only happens on explicit interaction (maximum one a frame)
        public void SetInt(uint key, int val)
        {
            var idx = FindByKey(key);

            if (idx < Data.Size && Data[idx].key == key)
            {
                var pair = Data[idx];
                pair.val_i = val;
                Data[idx]  = pair;
            }
            else
            {
                Data.insert(idx, new Pair(key, val));
            }
        }