Big optimizations and securing code.
[genetic.git] / include / generation.h
index 88942ec0d9fd2a0cac8e19b3762bee8cef227da8..f460a7fbe62cc408a6034b8ad42bf84420d9f78d 100644 (file)
@@ -32,7 +32,7 @@ namespace genetic {
          *
          * @param chromosomes vector containing Chromosomes to use in Generation
          */
-        Generation(vector<_Chromosome> chromosomes) {
+        Generation(const std::vector<_Chromosome>& chromosomes) {
             this->chromosomes = chromosomes;
         }
 
@@ -66,7 +66,7 @@ namespace genetic {
          *
          * @return i-th Chromosome in the current Generation
          */
-        _Chromosome& operator[](unsigned int i) {
+        _Chromosome& operator[](const unsigned int i) {
             return this->chromosomes[i];
         }
     };