Skip to content

Commit

Permalink
Replace boost::adaptors::reverse with std::vector::reverse (#3738)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramon-bernardo authored Oct 23, 2021
1 parent a26e2e1 commit d057d51
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/protocolgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

#include "otpch.h"

#include <boost/range/adaptor/reversed.hpp>

#include "protocolgame.h"

#include "outputmessage.h"
Expand Down Expand Up @@ -621,7 +619,8 @@ void ProtocolGame::GetTileDescription(const Tile* tile, NetworkMessage& msg)

const CreatureVector* creatures = tile->getCreatures();
if (creatures) {
for (const Creature* creature : boost::adaptors::reverse(*creatures)) {
for (auto it = creatures->rbegin(), end = creatures->rend(); it != end; ++it) {
const Creature* creature = (*it);
if (!player->canSeeCreature(creature)) {
continue;
}
Expand Down
5 changes: 2 additions & 3 deletions src/tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

#include "otpch.h"

#include <boost/range/adaptor/reversed.hpp>

#include "tile.h"

#include "creature.h"
Expand Down Expand Up @@ -1218,7 +1216,8 @@ int32_t Tile::getClientIndexOfCreature(const Player* player, const Creature* cre
}

if (const CreatureVector* creatures = getCreatures()) {
for (const Creature* c : boost::adaptors::reverse(*creatures)) {
for (auto it = creatures->rbegin(), end = creatures->rend(); it != end; ++it) {
const Creature* c = (*it);
if (c == creature) {
return n;
} else if (player->canSeeCreature(c)) {
Expand Down

0 comments on commit d057d51

Please sign in to comment.