mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-04 10:35:27 +08:00 
			
		
		
		
	
				
					committed by
					
						
						Phil Scott
					
				
			
			
				
	
			
			
			
						parent
						
							fa553fd72e
						
					
				
				
					commit
					865552c3f2
				
			
							
								
								
									
										24
									
								
								src/Spectre.Console/Extensions/StackExtensions.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								src/Spectre.Console/Extensions/StackExtensions.cs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
 | 
			
		||||
namespace Spectre.Console
 | 
			
		||||
{
 | 
			
		||||
    internal static class StackExtensions
 | 
			
		||||
    {
 | 
			
		||||
        public static void PushRange<T>(this Stack<T> stack, IEnumerable<T> source)
 | 
			
		||||
        {
 | 
			
		||||
            if (stack is null)
 | 
			
		||||
            {
 | 
			
		||||
                throw new ArgumentNullException(nameof(stack));
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (source != null)
 | 
			
		||||
            {
 | 
			
		||||
                foreach (var item in source)
 | 
			
		||||
                {
 | 
			
		||||
                    stack.Push(item);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user