mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 15:12:45 +00:00 
			
		
		
		
	AK/Vector: Add Vector::reverse() method
				
					
				
			This reverses the contents of the vector in-place.
This commit is contained in:
		
							parent
							
								
									a339b73fc2
								
							
						
					
					
						commit
						27f28998b1
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		|  | @ -746,6 +746,12 @@ public: | |||
|         return {}; | ||||
|     } | ||||
| 
 | ||||
|     void reverse() | ||||
|     { | ||||
|         for (size_t i = 0; i < size() / 2; ++i) | ||||
|             AK::swap(at(i), at(size() - i - 1)); | ||||
|     } | ||||
| 
 | ||||
| private: | ||||
|     void reset_capacity() | ||||
|     { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Mustafa Quraish
						Mustafa Quraish