Beispiel #1
0
 private static KeysList LoadSpace(string space)
 {
     return(new KeysList(Sizes[space],
                         ValuesStorage.GetStringList(space)
                         .Select(y => y.Split(new[] { '\n' }, 2))
                         .Select(y => new KeyValue(Storage.Decode(y[0]), y[1]))));
 }
Beispiel #2
0
            public Space(string key, int size)
            {
                var s = Stopwatch.StartNew();

                _key    = key;
                _values = new KeyValue[size];
                var i = 0;

                foreach (var line in ValuesStorage.GetStringList(key))
                {
                    var split = line.Split(new[] { '\n' }, 2);
                    if (split.Length < 2 || string.IsNullOrWhiteSpace(split[0]))
                    {
                        continue;
                    }
                    _values[i++] = new KeyValue(Storage.Decode(split[0]), split[1]);
                }

                if (s.Elapsed.TotalMilliseconds > 2)
                {
                    Logging.Debug($"{_key}, loaded {i} values : {s.Elapsed.TotalMilliseconds:F2} ms");
                }
            }