public void Add(string key, byte[] map)
{
int index = 0;
int limit = this.owner.BucketSizeLimit;
while (index<this.keys.Count)
{
string thiskey = (string) this.keys[index];
int comparison = this.owner.Compare(thiskey, key);
if (comparison==0)
{
this.values[index] = map;
this.keys[index] = key;
return;
}
if (comparison>0)
{
this.values.Insert(index, map);
this.keys.Insert(index, key);
if (limit>0 && this.keys.Count>limit)
{
throw new BplusTreeBadKeyValue("bucket size limit exceeded");
}
return;
}
index++;
}
this.keys.Add(key);
this.values.Add(map);
if (limit>0 && this.keys.Count>limit)
{
throw new BplusTreeBadKeyValue("bucket size limit exceeded");
}
}