solved the block end problem, commiting mostly to save all those neat debug statement...
[clinton/Smoothieware.git] / src / libs / ConfigCache.h
index c12ddcc..9297730 100644 (file)
@@ -25,15 +25,17 @@ class ConfigCache : public std::vector<ConfigValue*> {
             for( int i=1; i<this->size(); i++){
                 // If this configvalue matches the checksum 
                 bool match = true;
-                for( unsigned int j = 0; j < new_value->check_sums.size(); j++ ){
-                    uint16_t checksum_node = new_value->check_sums[j];
-                    if(this->at(i)->check_sums[j] != checksum_node ){
+                char counter = 0;
+                while( new_value->check_sums[counter] != 0x0000 && counter < 3 ){
+                    if(this->at(i)->check_sums[counter] != new_value->check_sums[counter]  ){
                         match = false;
                         break; 
                     }
-                } 
+                    counter++;
+                }
                 if( match == false ){ continue; }
                 value_exists = true;
+                
                 // Replace with the provided value 
                 delete this->at(i);
                 this->at(i) = new_value;