zzj 6 vuotta sitten
vanhempi
commit
019252d59f
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      monkey_car/monkey_fit.h

+ 3 - 0
monkey_car/monkey_fit.h

@@ -44,6 +44,9 @@ struct monkey_fit
 			s-=it->second; ++it;
 		}
 
+		if(p.empty())
+			return 0;
+
 		std::sort(p.begin(),p.end(),[](const std::tuple<T,T,int>&l,const std::tuple<T,T,int>&r){
 			return 1.*std::get<2>(l) > 1.*std::get<2>(r);
 		});