mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pulse-server: module: use SPA_FOR_EACH_ELEMENT()
Since `module_list` is a fixed-sized array, `SPA_FOR_EACH_ELEMENT()` can be used. So use that. This way there is no need for explicit indexing nor a sentinel at the end.
This commit is contained in:
		
							parent
							
								
									6aba315b82
								
							
						
					
					
						commit
						4fbe3cbfc6
					
				
					 1 changed files with 6 additions and 5 deletions
				
			
		| 
						 | 
					@ -267,16 +267,17 @@ static const struct module_info module_list[] = {
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
	{ "module-roc-sink", create_module_roc_sink, },
 | 
						{ "module-roc-sink", create_module_roc_sink, },
 | 
				
			||||||
	{ "module-roc-source", create_module_roc_source, },
 | 
						{ "module-roc-source", create_module_roc_source, },
 | 
				
			||||||
	{ NULL, }
 | 
					 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static const struct module_info *find_module_info(const char *name)
 | 
					static const struct module_info *find_module_info(const char *name)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int i;
 | 
						const struct module_info *info;
 | 
				
			||||||
	for (i = 0; module_list[i].name != NULL; i++) {
 | 
					
 | 
				
			||||||
		if (spa_streq(module_list[i].name, name))
 | 
						SPA_FOR_EACH_ELEMENT(module_list, info) {
 | 
				
			||||||
			return &module_list[i];
 | 
							if (spa_streq(info->name, name))
 | 
				
			||||||
 | 
								return info;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return NULL;
 | 
						return NULL;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue