Skip to content

Commit

Permalink
fix: sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
phacUFPE committed Nov 16, 2024
1 parent 726db1b commit 2e34768
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/server/network/protocol/protocolgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5746,8 +5746,10 @@ void ProtocolGame::sendForgeHistory(uint8_t page) {
auto historyVector = player->getForgeHistory();
auto historyVectorLen = historyVector.size();

uint16_t currentPage, lastPage = 1;
uint16_t pageFirstEntry, pageLastEntry = 0;
uint16_t currentPage = 1;
uint16_t lastPage = 1;
uint16_t pageFirstEntry = 0;

Check warning on line 5751 in src/server/network/protocol/protocolgame.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

[cppcheck] src/server/network/protocol/protocolgame.cpp#L5751

The scope of the variable 'pageFirstEntry' can be reduced.
Raw output
src/server/network/protocol/protocolgame.cpp:5751:The scope of the variable 'pageFirstEntry' can be reduced.

Check warning on line 5751 in src/server/network/protocol/protocolgame.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

[cppcheck] src/server/network/protocol/protocolgame.cpp#L5751

Variable 'pageFirstEntry' is assigned a value that is never used.
Raw output
src/server/network/protocol/protocolgame.cpp:5751:Variable 'pageFirstEntry' is assigned a value that is never used.
uint16_t pageLastEntry = 0;

Check warning on line 5752 in src/server/network/protocol/protocolgame.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

[cppcheck] src/server/network/protocol/protocolgame.cpp#L5752

The scope of the variable 'pageLastEntry' can be reduced.
Raw output
src/server/network/protocol/protocolgame.cpp:5752:The scope of the variable 'pageLastEntry' can be reduced.

Check warning on line 5752 in src/server/network/protocol/protocolgame.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

[cppcheck] src/server/network/protocol/protocolgame.cpp#L5752

Variable 'pageLastEntry' is assigned a value that is never used.
Raw output
src/server/network/protocol/protocolgame.cpp:5752:Variable 'pageLastEntry' is assigned a value that is never used.

std::vector<ForgeHistory> historyPerPage;
if (historyVectorLen > 0) {
Expand Down

0 comments on commit 2e34768

Please sign in to comment.