Esempio n. 1
0
            private void GetSlotNames(int col, ref VBuffer <ReadOnlyMemory <char> > dst)
            {
                Contracts.Assert(col == 0);

                var nameList  = new List <ReadOnlyMemory <char> >();
                var indexList = new List <int>();

                foreach (var kvp in _collection.GetNonDefaultFeatureNames())
                {
                    nameList.Add(kvp.Value.AsMemory());
                    indexList.Add(kvp.Key);
                }

                Contracts.Assert(nameList.Count == indexList.Count);

                var editor = VBufferEditor.Create(ref dst, _collection.Count, nameList.Count);

                nameList.CopyTo(editor.Values);
                if (nameList.Count < _collection.Count)
                {
                    indexList.CopyTo(editor.Indices);
                }

                dst = editor.Commit();
            }