|
The difference is different, but the if () statement has little effect here, because list1.size is used to traverse the list every time to get its size. If you repeatedly use the size attribute of list, it is best to First take it out and put it in the int variable. For example, if there is such a statement for (; list.size;) {} It is better to use the latter method |
|