diff options
| author | Charlie Blake | 2018-06-13 15:38:20 +0100 |
|---|---|---|
| committer | GitHub | 2018-06-13 15:38:20 +0100 |
| commit | ccb1232a48deef855d0e0f3ea0f69382494975cc (patch) | |
| tree | bcc8fe29ea84abbd6682c1a880064a90dd65f959 /src/main/game/pile.cpp | |
| parent | Merge pull request #59 from thecharlesblake/paper-tidy-up (diff) | |
| parent | Add default cache capacity of 100,000,000 (diff) | |
| download | metasol-ccb1232a48deef855d0e0f3ea0f69382494975cc.tar.gz metasol-ccb1232a48deef855d0e0f3ea0f69382494975cc.zip | |
Merge pull request #60 from thecharlesblake/cache-mem-limit
Cache mem limit
Diffstat (limited to 'src/main/game/pile.cpp')
| -rw-r--r-- | src/main/game/pile.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/game/pile.cpp b/src/main/game/pile.cpp index 3136681..23a02af 100644 --- a/src/main/game/pile.cpp +++ b/src/main/game/pile.cpp @@ -35,7 +35,9 @@ card& pile::operator[] (size_type i) { } card pile::operator[] (size_type i) const { - return pile_vec[pile_vec.size() - 1 - i]; + vector<card>::size_type s = pile_vec.size() - 1 - i; + assert(s < pile_vec.size()); + return pile_vec[s]; } void pile::place(const card c) { |
