JDimproved / JDim

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

Fix code that accesses the moved variable #1332

Closed ma8ma closed 5 months ago

ma8ma commented 5 months ago

moveしたあとの変数にアクセスしているとcppcheckに指摘されたため修正します。

cppcheck 2.13.0のレポート (with inconclusive option)

src/linkfilterpref.cpp:218:26: warning: inconclusive: Access of moved variable 'item'. [accessMoved]
            std::cout << item.url << " " << item.cmd << std::endl;
                         ^
src/linkfilterpref.cpp:216:34: note: Calling std::move(item)
            list_item.push_back( std::move( item ) );
                                 ^
src/linkfilterpref.cpp:218:26: note: Access of moved variable 'item'.
            std::cout << item.url << " " << item.cmd << std::endl;
                         ^