IndexScan() public méthode

public IndexScan ( ) : IEnumerable
Résultat IEnumerable
Exemple #1
0
        public IEnumerable <Tuple <long, long> > Scan()
        {
            foreach (var treeNode in tree.IndexScan())
            {
                if (treeNode.NodeValue == null)
                {
                    continue;
                }

                tree.Remove(treeNode.NodeKey);

                var readCount = treeNode.NodeKey.Value <int>("Reads") + 1;
                if (readCount > 5)
                {
                    continue;
                }

                tree.Add(JObject.FromObject(new { Id = currentId, Reads = readCount }),
                         treeNode.NodeValue.Value);

                yield return(new Tuple <long, long>(
                                 treeNode.NodeValue.Value,
                                 treeNode.NodeKey.Value <long>("Id")
                                 ));
            }
        }