]> Creatis software - bbtk.git/commitdiff
Clean code
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Tue, 24 Feb 2026 15:29:16 +0000 (16:29 +0100)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Tue, 24 Feb 2026 15:29:16 +0000 (16:29 +0100)
packages/std/src/bbstdVectorFilterDouble.cxx

index f4e0d69524c50f6d54e968c55f9812b7bfa8596f..3e1bb8c234935d4476538e0be4831996059296e4 100644 (file)
@@ -70,7 +70,6 @@ void VectorFilterDouble::Process()
        pLstVecOut.push_back( &Out9 );
     if (bbGetInputType()==-1)  // Erase lines if In0==k1
     {
-        double k1 = bbGetInputk1()[0];
         if (bbGetInputIn0().size()!=0)  // At least one element
         {
             bool okSizeVec=true;
@@ -79,10 +78,15 @@ void VectorFilterDouble::Process()
             {
                 if ( (*pLstVec[ipLstvec]).size()!=(*pLstVec[0]).size() )  { okSizeVec=false; }
             }
+            if (bbGetInputk1().size()!=0)
+            {
+                okSizeVec=false;
+            }
             if ( okSizeVec==false)
             {
-                printf("EED VectorFilterDouble::Process WARNING! vectors are not of the same size.\n");
+                printf("EED VectorFilterDouble::Process WARNING! vectors are not of the same size. And k1 need one element.\n");
             } else {
+                double k1 = bbGetInputk1()[0];
                 int iLine;
                 int ipLstvec2;
                 bool okLine;
@@ -99,7 +103,7 @@ void VectorFilterDouble::Process()
 //                        if ( (*pLstVec[ipLstvec2])[iLine]!=(*pLstVec[ipLstvec2])[iLine-1] )  { okLine=true; }
 //                    } // for ipLstVec2
                             
-                    if ( (okLine==true) || (iLine==0) )
+                    if ( okLine==true)
                     {
                         for (ipLstvec2=0 ; ipLstvec2<pLstVec.size() ; ipLstvec2++)
                         {
@@ -109,7 +113,7 @@ void VectorFilterDouble::Process()
                 } // for iLine
             } // if okSizeVec
         } // bbGetInputIn0()  size
-    } // Type==0
+    } // Type==-1
     
     if (bbGetInputType()==0)  // Erase duplicate lines
     {