Do not declare variables in determining if statement

int sze = listVertex.size();
    if (sze > 0) {

These are the correct form, the form is wrong.

if (int sze = listVertex.size()> 0) {

Lazy way to determine the edge of this side of the assignment statement, in fact, did not last sze is given the value you want, cause the program to crash later. It can be seen clearly through the breakpoints.

Guess you like

Origin www.cnblogs.com/mrlonely2018/p/11921013.html