Exemplo n.º 1
0
        public void CompileParallel(IEnumerable <ActionSource> input, IInjectable <UnityComponentSource> output)
        {
            int count = -1;

            Parallel.ForEach(input, src =>
            {
                var builder = new StringBuilder(Config.MAX_KEY_LENGTH);

                for (int i = src.startOffset; i != src.count; i++)
                {
                    if (src.context[i] == ' ')
                    {
                        output.Push()
                    }
                    else
                    {
                        builder.Append(src.context[i]);
                    }
                }
            });
        }
Exemplo n.º 2
0
        public void OnUpdate(IEnumerable <ActionSource> input, IInjectable <UnityComponentSource> output)
        {
            Parallel.ForEach(input, src =>
            {
                var builder = _builderPool.GetObject();

                string cmd;
                string arg;
                for (int i = src.startOffset; i != src.count; i++)
                {
                    if (src.context[i] == ' ')
                    {
                    }
                    else
                    {
                        builder.Append(src.context[i]);
                    }
                }

                output.Push();

                _builderPool.PutObject(builder);
            });
        }