Apply small optimizations.
[genetic.git] / src / gene.h
index f3b3c55fa1846ae6efc45c339724afd8d4421e20..781cd3e29d67978dc2b27e965746a1fe53a6f645 100644 (file)
@@ -15,6 +15,8 @@ namespace genetic {
          * with additional changes complex struct.
          */
         Type value;
+
+        template<typename> friend class Gene;
     public:
         /**
          * Default constructor
@@ -29,7 +31,7 @@ namespace genetic {
         }
 
         /** Copy constructor */
-        Gene(const Gene& gene) : value(gene.get()) {}
+        Gene(const Gene& gene) : value(gene.value) {}
 
         /**
          * Copy operator.
@@ -38,7 +40,7 @@ namespace genetic {
          * @return Gene instance containing copied value
          */
         Gene& operator=(const Gene& gene) {
-            this->value = gene.get();
+            this->value = gene.value;
             return *this;
         }