mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
Prefer std::find over a hand-coded loop
tested for no regression. STC: LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 37378 W: 6649 L: 6556 D: 24173 No functional change. Closes #1071
This commit is contained in:
parent
9d3ed9ed2e
commit
57a3334322
1 changed files with 3 additions and 2 deletions
|
@ -21,6 +21,8 @@
|
|||
#ifndef MOVEGEN_H_INCLUDED
|
||||
#define MOVEGEN_H_INCLUDED
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "types.h"
|
||||
|
||||
class Position;
|
||||
|
@ -59,8 +61,7 @@ struct MoveList {
|
|||
const ExtMove* end() const { return last; }
|
||||
size_t size() const { return last - moveList; }
|
||||
bool contains(Move move) const {
|
||||
for (const auto& m : *this) if (m == move) return true;
|
||||
return false;
|
||||
return std::find(begin(), end(), move) != end();
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Reference in a new issue