diff options
author | alberth <alberth@openttd.org> | 2015-08-08 10:06:24 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2015-08-08 10:06:24 +0000 |
commit | b885d79f506bde93b4ab278b3f84b8ca6254f3b9 (patch) | |
tree | ed7e027c4444181baab5b4ef6b667cd179f29a65 /src/pathfinder/yapf/yapf_costcache.hpp | |
parent | 9cadc0e1504cf979c14e1cb42bfe51a29675dd81 (diff) | |
download | openttd-b885d79f506bde93b4ab278b3f84b8ca6254f3b9.tar.xz |
(svn r27362) -Codechange: Codestyle fixes for reference var declarations, static cast type, operator methods.
Diffstat (limited to 'src/pathfinder/yapf/yapf_costcache.hpp')
-rw-r--r-- | src/pathfinder/yapf/yapf_costcache.hpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/pathfinder/yapf/yapf_costcache.hpp b/src/pathfinder/yapf/yapf_costcache.hpp index 7a568b703..a3e40d13e 100644 --- a/src/pathfinder/yapf/yapf_costcache.hpp +++ b/src/pathfinder/yapf/yapf_costcache.hpp @@ -30,7 +30,7 @@ public: * Called by YAPF to attach cached or local segment cost data to the given node. * @return true if globally cached data were used or false if local data was used */ - inline bool PfNodeCacheFetch(Node& n) + inline bool PfNodeCacheFetch(Node &n) { return false; } @@ -39,7 +39,7 @@ public: * Called by YAPF to flush the cached segment cost data back into cache storage. * Current cache implementation doesn't use that. */ - inline void PfNodeCacheFlush(Node& n) + inline void PfNodeCacheFlush(Node &n) { } }; @@ -67,7 +67,7 @@ protected: /** to access inherited path finder */ inline Tpf& Yapf() { - return *static_cast<Tpf*>(this); + return *static_cast<Tpf *>(this); } public: @@ -75,7 +75,7 @@ public: * Called by YAPF to attach cached or local segment cost data to the given node. * @return true if globally cached data were used or false if local data was used */ - inline bool PfNodeCacheFetch(Node& n) + inline bool PfNodeCacheFetch(Node &n) { CacheKey key(n.GetKey()); Yapf().ConnectNodeToCachedData(n, *new (m_local_cache.Append()) CachedData(key)); @@ -86,7 +86,7 @@ public: * Called by YAPF to flush the cached segment cost data back into cache storage. * Current cache implementation doesn't use that. */ - inline void PfNodeCacheFlush(Node& n) + inline void PfNodeCacheFlush(Node &n) { } }; @@ -142,7 +142,7 @@ struct CSegmentCostCacheT m_heap.Clear(); } - inline Tsegment& Get(Key& key, bool *found) + inline Tsegment& Get(Key &key, bool *found) { Tsegment *item = m_map.Find(key); if (item == NULL) { @@ -175,14 +175,14 @@ public: typedef CSegmentCostCacheT<CachedData> Cache; protected: - Cache& m_global_cache; + Cache &m_global_cache; inline CYapfSegmentCostCacheGlobalT() : m_global_cache(stGetGlobalCache()) {}; /** to access inherited path finder */ inline Tpf& Yapf() { - return *static_cast<Tpf*>(this); + return *static_cast<Tpf *>(this); } inline static Cache& stGetGlobalCache() @@ -211,14 +211,14 @@ public: * Called by YAPF to attach cached or local segment cost data to the given node. * @return true if globally cached data were used or false if local data was used */ - inline bool PfNodeCacheFetch(Node& n) + inline bool PfNodeCacheFetch(Node &n) { if (!Yapf().CanUseGlobalCache(n)) { return Tlocal::PfNodeCacheFetch(n); } CacheKey key(n.GetKey()); bool found; - CachedData& item = m_global_cache.Get(key, &found); + CachedData &item = m_global_cache.Get(key, &found); Yapf().ConnectNodeToCachedData(n, item); return found; } @@ -227,7 +227,7 @@ public: * Called by YAPF to flush the cached segment cost data back into cache storage. * Current cache implementation doesn't use that. */ - inline void PfNodeCacheFlush(Node& n) + inline void PfNodeCacheFlush(Node &n) { } }; |