Copy-Paste
V523 The ‘then’ statement is equivalent to the ‘else’ statement. matrix_type.cc 312
DEFUN(....) { .... if (str_typ == "upper") mattyp.mark_as_permuted(len, p); else mattyp.mark_as_permuted(len, p); .... }
There is no need to remind you that one should be very careful using the copy-paste technique when writing similarly looking constructs to avoid errors like this. It is doubtful that there should be two identical statements in the if-else block; a much more likely thing is that the mark_as_unpermuted method should be called when the else branch is triggered. Moreover, the programmer copied a part of code containing this buggy block to use in one more function later in the code, thus duplicating the error.
Please click here to see more bugs from this project.