From d206ce3bf86e432d27c7d79a56925f9b8e32c8d4 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 6 Feb 2015 13:15:37 +0000 Subject: [PATCH] made function efficient, and removed pointless semicolon --- Saviour Backup System/USBTools.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Saviour Backup System/USBTools.cs b/Saviour Backup System/USBTools.cs index 7f0df9a..46c1ab5 100644 --- a/Saviour Backup System/USBTools.cs +++ b/Saviour Backup System/USBTools.cs @@ -92,11 +92,7 @@ namespace Saviour_Backup_System } - public static int countDrives() { - int numberofDrives = 0; - foreach (DriveInfo drive in getConnectedDrives()) { numberofDrives++; } - return numberofDrives; - } + public static int countDrives() { return getConnectedDrives().Length; } public static int spacePercentage(DriveInfo drive) { @@ -107,7 +103,7 @@ namespace Saviour_Backup_System } public static string calculateDriveID(DriveInfo drive) { - return tools.hash(drive.VolumeLabel + drive.TotalSize + drive.DriveFormat + USBTools.getDriveType(drive)); ; + return tools.hash(drive.VolumeLabel + drive.TotalSize + drive.DriveFormat + USBTools.getDriveType(drive)); }