Skip to content

Commit

Permalink
put unit_map debug mode compilation on its own define
Browse files Browse the repository at this point in the history
This helps with profiling using callgrind.
  • Loading branch information
cbeck88 committed Jun 13, 2014
1 parent d7c2675 commit 36d59f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/unit_map.cpp
Expand Up @@ -332,7 +332,7 @@ std::vector<unit_map::const_unit_iterator> unit_map::find_leaders(int side)const
return const_leaders;
}

#ifdef DEBUG
#ifdef DEBUG_UNIT_MAP

bool unit_map::self_check() const {
bool good(true);
Expand Down
4 changes: 3 additions & 1 deletion src/unit_map.hpp
Expand Up @@ -26,6 +26,8 @@
#include <map>
#include <boost/unordered_map.hpp>

//#define DEBUG_UNIT_MAP

class unit;

/**
Expand Down Expand Up @@ -373,7 +375,7 @@ class unit_map {

///Checks invariants. For debugging purposes only. Doesn't do anything in non-debug mode.
bool self_check() const
#ifndef DEBUG
#ifndef DEBUG_UNIT_MAP
{ return true; }
#else
;
Expand Down

0 comments on commit 36d59f7

Please sign in to comment.