mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 13:50:03 +00:00 
			
		
		
		
	video_core: reduce string allocations in shader decompiler (#5261)
* video_core: reduce string allocations in shader decompiler * use append for indentation instead of resize Co-authored-by: Mat M. <mathew1800@gmail.com>
This commit is contained in:
		
							parent
							
								
									b82d4315fe
								
							
						
					
					
						commit
						db5b8b9c88
					
				
					 1 changed files with 4 additions and 3 deletions
				
			
		|  | @ -196,12 +196,13 @@ private: | |||
| 
 | ||||
| class ShaderWriter { | ||||
| public: | ||||
|     void AddLine(const std::string& text) { | ||||
|     void AddLine(std::string_view text) { | ||||
|         DEBUG_ASSERT(scope >= 0); | ||||
|         if (!text.empty()) { | ||||
|             shader_source += std::string(static_cast<std::size_t>(scope) * 4, ' '); | ||||
|             shader_source.append(static_cast<std::size_t>(scope) * 4, ' '); | ||||
|         } | ||||
|         shader_source += text + '\n'; | ||||
|         shader_source += text; | ||||
|         shader_source += '\n'; | ||||
|     } | ||||
| 
 | ||||
|     std::string MoveResult() { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue