# 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:

    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:

    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:

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

The correct code:

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

You can look at examples of errors detected by the V587 diagnostic.