File tree Expand file tree Collapse file tree 3 files changed +16
-10
lines changed Expand file tree Collapse file tree 3 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -43,8 +43,10 @@ class base_uint
43
43
44
44
base_uint& operator =(const base_uint& b)
45
45
{
46
- for (int i = 0 ; i < WIDTH; i++)
47
- pn[i] = b.pn [i];
46
+ if (this != &b) {
47
+ for (int i = 0 ; i < WIDTH; i++)
48
+ pn[i] = b.pn [i];
49
+ }
48
50
return *this ;
49
51
}
50
52
Original file line number Diff line number Diff line change @@ -75,13 +75,15 @@ class CKey
75
75
76
76
CKey& operator =(const CKey& other)
77
77
{
78
- if (other.keydata ) {
79
- MakeKeyData ();
80
- *keydata = *other.keydata ;
81
- } else {
82
- ClearKeyData ();
78
+ if (this != &other) {
79
+ if (other.keydata ) {
80
+ MakeKeyData ();
81
+ *keydata = *other.keydata ;
82
+ } else {
83
+ ClearKeyData ();
84
+ }
85
+ fCompressed = other.fCompressed ;
83
86
}
84
- fCompressed = other.fCompressed ;
85
87
return *this ;
86
88
}
87
89
Original file line number Diff line number Diff line change @@ -1508,8 +1508,10 @@ struct Tracker
1508
1508
Tracker (Tracker&& t) noexcept : origin(t.origin), copies(t.copies) {}
1509
1509
Tracker& operator =(const Tracker& t) noexcept
1510
1510
{
1511
- origin = t.origin ;
1512
- copies = t.copies + 1 ;
1511
+ if (this != &t) {
1512
+ origin = t.origin ;
1513
+ copies = t.copies + 1 ;
1514
+ }
1513
1515
return *this ;
1514
1516
}
1515
1517
};
You can’t perform that action at this time.
0 commit comments