Only call recurse() when path points to a directory in du(1)
This improves performance by ~30%.
Cette révision appartient à :
		
							
								
								
									
										3
									
								
								du.c
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								du.c
									
									
									
									
									
								
							@@ -47,7 +47,8 @@ du(const char *path, int depth, void *total)
 | 
				
			|||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	recurse(path, du, depth, &subtotal);
 | 
						if (S_ISDIR(st.st_mode))
 | 
				
			||||||
 | 
							recurse(path, du, depth, &subtotal);
 | 
				
			||||||
	*((size_t *)total) += subtotal + nblks(st.st_blocks);
 | 
						*((size_t *)total) += subtotal + nblks(st.st_blocks);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!sflag && depth <= maxdepth && (S_ISDIR(st.st_mode) || aflag))
 | 
						if (!sflag && depth <= maxdepth && (S_ISDIR(st.st_mode) || aflag))
 | 
				
			||||||
 
 | 
				
			|||||||
		Référencer dans un nouveau ticket
	
	Bloquer un utilisateur