Changeset dbd19f for molecuilder/src/vector.cpp
- Timestamp:
- Jan 28, 2010, 1:54:35 PM (16 years ago)
- Children:
- 03d7ac
- Parents:
- d34341
- git-author:
- Tillmann Crueger <crueger@…> (01/28/10 13:02:49)
- git-committer:
- Tillmann Crueger <crueger@…> (01/28/10 13:54:35)
- File:
-
- 1 edited
-
molecuilder/src/vector.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/vector.cpp
rd34341 rdbd19f 663 663 }; 664 664 665 Vector& Vector::operator=(const Vector& src) { 666 CopyVector(src); 667 return *this; 668 } 669 665 670 /** Prints a 3dim vector. 666 671 * prints no end of line. … … 1076 1081 void Vector::CopyVector(const Vector * const y) 1077 1082 { 1078 for (int i=NDIM;i--;) 1079 this->x[i] = y->x[i]; 1083 // check for self assignment 1084 if(y!=this){ 1085 for (int i=NDIM;i--;) 1086 this->x[i] = y->x[i]; 1087 } 1080 1088 } 1081 1089 … … 1085 1093 void Vector::CopyVector(const Vector &y) 1086 1094 { 1087 for (int i=NDIM;i--;) 1088 this->x[i] = y.x[i]; 1095 // check for self assignment 1096 if(&y!=this) { 1097 for (int i=NDIM;i--;) 1098 this->x[i] = y.x[i]; 1099 } 1089 1100 } 1090 1101
Note:
See TracChangeset
for help on using the changeset viewer.
