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);
            }
        }
Exemple #2
0
        public SexContext()
        {
            _filter[0] = new CountSet();
            _filter[1] = new CountSet();
            _groups[0] = DelaySortedList <int> .CreateDefault();

            _groups[1] = DelaySortedList <int> .CreateDefault();
        }
Exemple #3
0
        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;
        }
Exemple #5
0
        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);
        }