<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>Hello, </div><div>    recently, as an exercise, I have implemented a checker for clang static analyzer.It checks the call of std::list::size( ) .</div><div><br></div><div><span style="line-height: 1.7;">    </span><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: 13px; line-height: 15.6000003814697px;">It is more efficient to use containers </span><code style="color: rgb(34, 34, 34);">empty()</code><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: 13px; line-height: 15.6000003814697px;"> method to identify an empty container.Codes like bellow :</span></div><div><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: 13px; line-height: 15.6000003814697px;"><br></span></div><div>    int f() {</div><div>        list<int> l;</div><div>        if (l.empty() == 0) {</div><div>        }</div><div>     }    </div><div>    will be warned.</div><div><br></div><div> btw, I  did my dev on the release 3.5. </div><div><br></div><div>  </div></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>