Skip to content

Commit

Permalink
Update StorageManagement.cxx
Browse files Browse the repository at this point in the history
  • Loading branch information
ikdekker authored Feb 8, 2017
1 parent ce39b37 commit 6bcb6d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/StorageManagement.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ void StorageManagement::setDbAdapter(DatabaseAdapter* db) {
int StorageManagement::findFreeSpot(int modId) {
vector<int> res = dbAdapter->getEntriesByModule(modId);
ModuleEntity *mod = modules->getModuleById(modId);

if (mod == nullptr) return -1;
int nextSpot = 0;
int spotTotal = mod->getCols() * mod->getRows();
spotTotal--;

for (; nextSpot < spotTotal; nextSpot++) {
//check if spot has been taken, if so skip.
if (std::find(res.begin(), res.end(), nextSpot) != res.end())
Expand Down

0 comments on commit 6bcb6d4

Please sign in to comment.