mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Don't iterate over the dive_table to discover the number of dives
dive_table.nr is exactly that. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									dec2572ec6
								
							
						
					
					
						commit
						a809eec853
					
				
					 1 changed files with 1 additions and 6 deletions
				
			
		| 
						 | 
					@ -13,12 +13,7 @@ int getTotalWork(print_options *printOptions)
 | 
				
			||||||
		// but don't return 0 as we might divide by this number
 | 
							// but don't return 0 as we might divide by this number
 | 
				
			||||||
		return amount_selected ? amount_selected : 1;
 | 
							return amount_selected ? amount_selected : 1;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	int dives = 0, i;
 | 
						return dive_table.nr;
 | 
				
			||||||
	struct dive *dive;
 | 
					 | 
				
			||||||
	for_each_dive (i, dive) {
 | 
					 | 
				
			||||||
		dives++;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	return dives;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void find_all_templates()
 | 
					void find_all_templates()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue