mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 21:52:45 +00:00 
			
		
		
		
	LibC: Remove static from function local constexpr variable
Problem: - Function local `constexpr` variables do not need to be `static`. This consumes memory which is unnecessary and can prevent some optimizations. Solution: - Remove `static` keyword.
This commit is contained in:
		
							parent
							
								
									44a9c7c23e
								
							
						
					
					
						commit
						31d24d8292
					
				
					 2 changed files with 2 additions and 2 deletions
				
			
		|  | @ -165,7 +165,7 @@ inline int generate_unique_filename(char* pattern, Callback callback) | |||
| 
 | ||||
|     size_t start = length - 6; | ||||
| 
 | ||||
|     static constexpr char random_characters[] = "abcdefghijklmnopqrstuvwxyz0123456789"; | ||||
|     constexpr char random_characters[] = "abcdefghijklmnopqrstuvwxyz0123456789"; | ||||
| 
 | ||||
|     for (int attempt = 0; attempt < 100; ++attempt) { | ||||
|         for (int i = 0; i < 6; ++i) | ||||
|  |  | |||
|  | @ -21,7 +21,7 @@ static char* generate_random_filename(const char* pattern) | |||
|     char* new_filename = strdup(pattern); | ||||
|     int pattern_length = strlen(pattern); | ||||
| 
 | ||||
|     static constexpr char random_characters[] = "abcdefghijklmnopqrstuvwxyz0123456789"; | ||||
|     constexpr char random_characters[] = "abcdefghijklmnopqrstuvwxyz0123456789"; | ||||
|     for (auto i = pattern_length - 1; i >= 0; --i) { | ||||
|         if (pattern[i] != 'X') | ||||
|             break; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lenny Maiorani
						Lenny Maiorani