﻿# V587\. Suspicious sequence of assignments: A \= B; B \= A;\.

Analyzer detected a potential error concerning the senseless mutual assignment of variables\.

Let's review an example:

```cpp
int A, B, C;
...
A = B;
C = 10;
B = A;
```

Here the assignment "B\=A" lacks any sort of practical utility\. It is possibly a misprint or just an unnecessary operation\. The correct code:

```cpp
A = B;
C = 10;
B = A_2;
```

An example stated above is a synthetic one\. Let's see how such an error could appear in the source code of a real\-life application:

```cpp
// Swap; exercises counters
{
  RCPFooRef temp = f2;
  f2 = f3;
  f3 = f2;
}
```

The correct code:

```cpp
// Swap; exercises counters
{
  RCPFooRef temp = f2;
  f2 = f3;
  f3 = temp;
}
```