public void AddOrUpdate(int id, UnixTime time) { var oldYear = _id2time[id].Year; _id2time[id] = time; if (_years.ContainsKey(oldYear)) { _years[oldYear].Remove(id); _byYear[oldYear].DelayRemove(id); } var newYear = time.Year; if (!_years.ContainsKey(newYear)) { _years[newYear] = new CountSet(); var list = _byYear[newYear] = DelaySortedList <int> .CreateDefault(); _years[newYear].Add(id); list.Load(id); } else { _years[newYear].Add(id); _byYear[newYear].DelayAdd(id); } }
public SexContext() { _filter[0] = new CountSet(); _filter[1] = new CountSet(); _groups[0] = DelaySortedList <int> .CreateDefault(); _groups[1] = DelaySortedList <int> .CreateDefault(); }
public void LoadBatch(int id, UnixTime joined) { var newYear = joined.Year; if (!_years.ContainsKey(newYear)) { _years[newYear] = new CountSet(); } _years[newYear].Add(id); _id2time[id] = joined; }
public void LoadBatch(int id, UnixTime item) { var newYear = item.Year; if (!_years.ContainsKey(newYear)) { _years[newYear] = new CountSet(); _byYear[newYear] = DelaySortedList <int> .CreateDefault(); } _years[newYear].Add(id); _byYear[newYear].Load(id); _id2time[id] = item; }
public void AddOrUpdate(int id, UnixTime time) { var oldYear = _id2time[id].Year; _id2time[id] = time; if (_years.ContainsKey(oldYear)) { _years[oldYear].Remove(id); } var newYear = time.Year; if (!_years.ContainsKey(newYear)) { _years[newYear] = new CountSet(); } _years[newYear].Add(id); }