Parcourir la source

fix "(style) The scope of the variable 'count' can be reduced"

David Kalnischkies il y a 14 ans
Parent
commit
785412cf3b
1 fichiers modifiés avec 3 ajouts et 4 suppressions
  1. 3 4
      cmdline/apt-cdrom.cc

+ 3 - 4
cmdline/apt-cdrom.cc

@@ -150,10 +150,9 @@ bool DoAdd(CommandLine &)
    bool res = true;
 
    bool AutoDetect = _config->FindB("Acquire::cdrom::AutoDetect", true);
-   unsigned int count = 0;
-   
    if (AutoDetect && UdevCdroms.Dlopen())
    {
+      unsigned int count = 0;
       while (AutoDetectCdrom(UdevCdroms, count))
 	 res &= cdrom.Add(&log);
    } else {
@@ -178,10 +177,10 @@ bool DoIdent(CommandLine &)
    bool res = true;
 
    bool AutoDetect = _config->FindB("Acquire::cdrom::AutoDetect");
-   unsigned int count = 0;
-   
+
    if (AutoDetect && UdevCdroms.Dlopen())
    {
+      unsigned int count = 0;
       while (AutoDetectCdrom(UdevCdroms, count))
 	 res &= cdrom.Ident(ident, &log);
    } else {