JDimproved / JDim

2ch browser for linux
https://jdimproved.github.io/JDim/
GNU General Public License v2.0
46 stars 11 forks source link

BoardBase: Use std::any_of() instead of range-based for loops #1253

Closed ma8ma closed 1 year ago

ma8ma commented 1 year ago

std::any_of()が使えるとcppcheckに指摘されたためforループ文を修正します。

cppcheck 2.11.1のレポート

src/dbtree/boardbase.cpp:1557:9: style: Consider using std::any_of algorithm instead of a raw loop. [useStlAlgorithm]
        for( const std::string& word : m_list_abone_word_thread ) {
        ^
src/dbtree/boardbase.cpp:1565:0: style: Consider using std::any_of algorithm instead of a raw loop. [useStlAlgorithm]
            if( regex.exec( pat, article->get_subject(), offset, icase, newline, usemigemo, wchar ) ) return true;
^
src/dbtree/boardbase.cpp:1571:9: style: Consider using std::any_of algorithm instead of a raw loop. [useStlAlgorithm]
        for( const std::string& word : CONFIG::get_list_abone_word_thread() ) {
        ^
src/dbtree/boardbase.cpp:1579:0: style: Consider using std::any_of algorithm instead of a raw loop. [useStlAlgorithm]
            if( regex.exec( pat, article->get_subject(), offset, icase, newline, usemigemo, wchar ) ) return true;
^